PRO
Ramon
asked
N
Expert
Nisha Sharma answered
If you try to write two print() statements on the same line, Python needs a clear separator between them. Without one, Python wonât know where the first print() ends and the next one begins, so youâll get a syntax error.
For example, this wonât work:
print("Hello") print("World")But this works perfectly, because the semicolon ; separates the two commands:
print("Hello"); print("World")Youâll see:
Hello
WorldHope that helps. Feel free to ping if you need more help or have any more questions.
Python
This question was asked as part of the Learn Python Basics course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer
