adding triple quotes (””” “””) lets you print large bodies of text exactly as they appear (where the first print
text doesn’t count (notice that the first line starts as far left indented as possible in the picture below)
Capitalization matters. e.g. computer understands print
but not Print
input("what's your name")
prints “what’s your name”_ (where the _ is where the cursor waits for an input)print(myName, “is going to be”, myAdjective)
Example: print("Uh, oh, you've been given a", "\\033[31m", "warning", "\\033[0m", "for being a bad, bad person.")
Where "\\033[31m”
changes the color of all the text that comes after it in the print statement until dictated otherwise
Other colors:
Color | Value |
---|---|
Default | 0 |
Black | 30 |
Red | 31 |
Green | 32 |
Yellow | 33 |
Blue | 34 |
Purple | 35 |
Cyan | 36 |
White | 37 |
if player == “Mark”:
(must include colon) at the endelse:
make sure to include else on same level as the if, and then indent for the stuff that should be done if the condition is matched