Python Python Collections (2016, retired 2019) Dungeon Game Movement

Mohammed Jangda
Mohammed Jangda
1,701 Points

("\n") What does this mean? Kenneth never defined it and I have been confused since he started teaching, he is too quick

please help!

2 Answers

Steven Parker
Steven Parker
176,778 Points

That's what is called an "escape" sequence, where both characters together represent just one in the string. That particular one represents the invisible "newline" character, which causes the current line to end and prepares for the next thing printed to be on the next line.

Other common (but not as common) escape sequences are "\t" for tab and "\b" for backspace.

Mohammed Jangda
Mohammed Jangda
1,701 Points

Thank you for your reply! Could you not have just put "break"?

Steven Parker
Steven Parker
176,778 Points

Mohammed Jangda — The word "break" has a different meaning in Python, it's used for loop control. It doesn't represent a new line.

If that answered your question, you can mark it solved by choosing a "best answer".
And happy coding!