python turnary

JavaScript
# Program to demonstrate conditional operator 
a, b = 10, 20
# Copy value of a in min if a < b else copy b 
min = a if a < b else b a, b = 10, 20
# Copy value of a in min if a < b else copy b 
min = a if a < b else b (if_test_is_false, if_test_is_true)[test]
is_nice = True
state = "nice" if is_nice else "not nice"

Source

Also in JavaScript: