Ternary operator (Ternary operator) – used in line to set conditions in assigning a value to a variable. It is easier to understand this with examples.
cat_say = “Mew”
me_say = “Hi,cat” if cat_say == “Mew” or cat_say == “Myavki” else “Who are you?”
print(me_say)
Hi,cat #result