Conditional Logic

Run Settings
LanguagePython
Language Version
Run Command
is_old = True is_licensed = True print("When is_old is True and is_licensed is True:") if is_old: print("You are old enough to drive") elif is_licensed: print("You can drive now") else: print("You are too young.") print("\nWhen is_old is False and is_licensed is True:") is_old = False is_licensed = True if is_old: print("You are old enough to drive") elif is_licensed: print("You can drive now") else: print("You are too young.") print("\nWhen is_old is True and is_licensed is True:") is_old= True is_licensed=True if is_old and is_licensed: print("You are old enough to drive, and you have a license") else: print("You are too young.") print("\nWhen is_old is True and is_licensed is False:") is_old= True is_licensed=False if is_old and is_licensed: print("You are old enough to drive, and you have a license") else: print("You are too young.") print("\nWhen is_old is False and is_licensed is True:") is_old= False is_licensed=True if is_old and is_licensed: print("You are old enough to drive, and you have a license") elif is_old or is_licensed: print("You have a license but you are not old enough") else: print("You are too young.")
Editor Settings
Theme
Key bindings
Full width
Lines