Skip to content
Sign upLog in
← Back to Community

How do I start a new line?

Profile icon
NOUSERNAMEHI

I am not very good at Python

Answered by VulcanWM [earned 5 cycles]
View Answer
Voters
Profile icon
potatolori14
Profile icon
FrancescaCorbi1
Profile icon
durvishsyal1
Profile icon
RakeshRAJENDRA1
Profile icon
AliEl04
Profile icon
Mahumk66
Profile icon
cullenjy20
Profile icon
but511336
Profile icon
AsierMR
Profile icon
BLoBBERT
Comments
hotnewtop
Profile icon
VulcanWM

Use \n for a new line

Profile icon
OrvalHammes

I'm trying to write code for a computer science class. I know that the first thing that happens is that the program has to be entered into the computer, and then it has to be run, but when I type my code into a text file and save it as .py, nothing seems to happen when I open it up in IDLE. How do I tell python where to go when my program is run? I am told to explore https://knowtechie.com/top-6-most-popular-tech-tools-in-the-uk/ to learn about different tech tools to get the required help. What do you guys think?

Profile icon
jonross321

Use \n in a string to make a new line, or use triple quotations '''Place string here.''' to have multiple lines. If you are using text-based gaming like RPG, then I recommend the \n, but if you want to include ASCII art (making pictures out to many letters, symbols, numbers, and others) then use the triple quotes.

Profile icon
bobninja

just press enter

Profile icon
18WoodO

all you need to do if it is text is put the following in speech marks: \n
otherwise outside of this press enter

hope this helps

Profile icon
Kopamed

There are multiple ways to do it:
you can add a \n like

@medcho
said, or you can use the multiple ' thingy to write on different lines.

print('''This will be printed on multiple lines''')

Or you can just use the print statement:

print("hello") print("New line") print() print("skipped a line")