01 The age checker
Asks for an age and says whether the person can vote.
What happens: TypeError: '>=' not supported between instances of 'str' and 'int'
age = input("How old are you? ")
if age >= 18:
print("You can vote")
else:
print("Not yet")
Show the bug
input() always returns a string, and a string cannot be compared with a number. Convert it.
age = int(input("How old are you? "))
if age >= 18:
print("You can vote")
else:
print("Not yet")