1. To trial the platform and take tests, please take a few seconds to SIGN UP
and SET UP FREE.
2. Searching for something specific? See our text overview of all tests. Includes 'real teacher' use videos.
It helps to think of the three of them like this:
Each kind of statement is indented in the same way - with 4 spaces. Here’s an example of each:
if x == 5:
print("x is 5!")
if x == "Penny":
print("Your name is Penny!")
else:
print("Looks like your name isn't Penny!")
if age == 50:
print("You're really old!")
elif age == 20:
print("You're kind of young!")
elif age == 10:
print("You're a kid!")
else:
print("I wonder how old you are?")
www.teachyourselfpython.com