Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Ternary Operator in Python

# 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
  
print(min)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Ternary #Operator #Python
ADD COMMENT
Topic
Name
1+2 =