Quick actions

cmd+k|ctrl+k

Navigation

Languages

Exercise: Logical Operators

Snippet info

Language

Python

Visibility

public

Author

gustav

Created

2026-07-16T23:21:06.759094Z

Updated

2026-07-16T23:21:06.759094Z

is_magician = True
is_expert = True

#Check if magician AND expert: "you are a master magician"
if is_expert and is_magician:
    print("you are a master magician")
    
    
 #Check if magician but not expert: "at least you're getting there" 
elif is_magician and not is_expert:
    print("at least you're getting there")
    

#If you're not magician : "You need magic powers"
elif not is_magician:
    print("You need magic powers")
INFO