DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
7+1 =
Submit