Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python in line conditional statement

>>> age = 15
>>> print('kid' if age < 13 else 'teenager' if age < 18 else 'adult')
teenager
Source by www.pythoncentral.io #
 
PREVIOUS NEXT
Tagged: #python #line #conditional #statement
ADD COMMENT
Topic
Name
5+2 =