9/ if statements

if species == "cat":
  kingdom = "animal"
  print("Yep, it's cat.")

Coding exercices

10/ Comparison operators

if your_ticket_number != 487208:
    print("Better luck next time.")

Coding exercices

11/ else and elif statements

if species == "cat":
  print("Yep, it's cat.")
else:
  print("Nope, not cat.")

elif. It's short for else if:

if donut_condition == "fresh":
  buy_score = 10
elif donut_price == "low":
  buy_score = 5
else:
  buy_score = 0

Coding exercices