Displaying text in 2 different lines

I am able to print text in the given format-
Syntax: print(“Hello”,“World”)
Output: Hello World
How can I print in the following format?
Desirable output-
Hello
World


Type your question above this line.

Course: https://www.educative.io/collection/10370001/5473789393502208
Lesson: https://www.educative.io/collection/page/10370001/5473789393502208/6587356591161344

You can do this in multiple ways:

The suggested way is:

print("Hello", "World", sep="\n")

Alternatively:

print("Hello\nWorld")

OR like this:

print("Hello", "\n", "\bWorld")

OR this way:

print('''Hello
World''')

Happy learning at Educative

1 Like

Thank you

1 Like