+ 3

Why do we need "\n" in Phyton?

22nd Mar 2017, 2:50 PM
Artem White
Artem White - avatar
3 Answers
+ 5
\n moves the text to a new line. Like this: print("a\nb"); result: a b Theres more characters you can add to strings too! http://docs.oracle.com/javase/tutorial/java/data/characters.html
22nd Mar 2017, 3:02 PM
Rrestoring faith
Rrestoring faith - avatar
+ 1
it indicates new line try this print("Line\nNext Line")
22nd Mar 2017, 2:59 PM
Eranga
Eranga - avatar
+ 1
prints next line , can be compared to enter key in your keyboard (Examples) print ("love\n hate"); result: love hate print("love\n\nhate"); result: love hate
29th Mar 2017, 8:06 PM
Martin Karari
Martin Karari - avatar