Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

what is the ternary operator in python

condition = True
print("This condition is true!") if condition else print("This condition is false!")
# The if statement in one line! (Ternary operator)
Source by book.pythontips.com #
 
PREVIOUS NEXT
Tagged: #ternary #operator #python
ADD COMMENT
Topic
Name
6+5 =