Quick actions

cmd+k|ctrl+k

Navigation

Languages

Conditional Logic

Snippet info

Language

Python

Visibility

public

Author

legacy-v1-25425

Created

2026-01-28T19:34:00.53431Z

Updated

2026-01-29T14:39:21.714621Z

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.")
INFO