0
How to line break in Python?
I've tried \n and "\n" and it does not recognise it. print("I want to \n buy a cake.") Or print("I want to" + \n + buy a cake.") #i know that manually breaking the line achieves nothing. I just do it for the sake of keeping the code neat.
1 Odpowiedź
+ 9
print("I want to" + "\n" + "buy a cake")
"\n" is also a string that has escape sequence that is why it should also have "" around it, and if you want to concatenate strings.