๐Ÿ PyQuest๐Ÿค” Making Decisions ยท ๐Ÿšฆ The Mighty if
โญ 0 XP๐Ÿ Python is waking upโ€ฆ

The Mighty if ๐Ÿšฆ

Now that Python can answer True or False, you can make it do things only sometimes. That's what if is for:

temperature = 35

if temperature > 30:
    print("It's a scorcher out there! ๐Ÿฅต")

Two things to notice, and they both matter:

  1. The if line ends with a colon :
  2. The next line is indented (pushed in) โ€” that's how Python knows which code belongs to the if

If the comparison is True, the indented code runs. If it's False, Python skips right over it like it was never there.

Your mission

  1. Make a variable score and store a number in it
  2. Write an if that prints a celebration message when score is over 100
  3. Set score high enough that your message actually shows up!

Your code

Press โ–ถ Run to see what your code does!