One important thing to know about the print statement is that its string has to be all on one line. You can't do this:
print("this is broken here
onto the next line and doesn't work!")
On the plus side, you can have very long lines if you like. Alternatively, you can do this:
print("this is broken here " +
"onto the next line, but prints on one line!")
The plus "+" operator can join strings together ("concatinate" them).
If you're happy with your text printing out on multiple lines, you can also do this:
print("this is broken here")
print("onto the next line and prints on two lines!")
The last example gives us a key idea in coding. Programs are made of multiple lines of code in a sequence, one after another. Generally a computer will work from the top to the bottom of a page of code, unless told to do otherwise. We usually build up a program from the top to the bottom, at least when starting out.
[Home > Part 1 > Next]