r/pythonhelp • u/NeptunianEmp • Dec 26 '19
Beginner help with print command with multiple variables
What is the proper way for print(message0, message1, message2, message3,) to have each variable on the next line?
I have tried doing '\n' before and after each variable and only get a syntax error. I have also tried doing ,'\n\n\n\n', as I saw on another forum, and that did not work out.
3
Upvotes
1
u/the-bid-d Dec 26 '19
If the /n doesn't work, I found
(''' Whatever message you're trying to say ''')
1
u/sentles Dec 27 '19
Either one of the ways suggested, or print("{}\n{}\n{}\n{}".format(message0, ...).
Also note that \n should be inside a string, or you'll get the SyntaxError.
1
3
u/xelf Dec 27 '19 edited Dec 27 '19
or
or
Or simply: