Quiz

Truthy or Falsy?

An if doesn't need a real True/False, any value works. Python treats these as falsy (like False): 0, 0.0, "" (the empty string) and None. Empty lists are falsy too (you'll meet lists soon). Everything else is truthy.

name = input("Name? ")
if name:
    print(f"Hi {name}")
else:
    print("You didn't type anything!")

Which of these values counts as TRUE in an if statement?