+ 1
Why does this happen?
If you run the code "print("/n/n/n")", it outputs "../Playground/". Why? https://code.sololearn.com/c5qAoj3jnmWp/?ref=app
6 Réponses
+ 3
AJ 🇺🇦#PeaceForUkraine🇺🇦
/ represent file path location so you get /Playground
It is not a bug
You should do \n
+ 1
I know that. Thanks for telling me how and why that happens!
+ 1
Vlad Apet
\n creates new line not /n
/n is not a right syntax
+ 1
Exactly! And then there is \t for tabulation and \a for audio playback. The "\" character tells the compiler that it is followed not by simple text, but by a command. ( I don't know how for python, but for c++ it is )
+ 1
Thanks everyone
0
Haha, I found it really interesting, but now I get it because \n creates a new line. In C++, this means the same thing. ( I started learning python without even starting:) )