Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

if in one line python

if condition:
    value = true-expr
else:
    value = false-expr

# The same can be written in single line:
value = true-expr if condition else false-expr
Source by www.golinuxcloud.com #
 
PREVIOUS NEXT
Tagged: #line #python
ADD COMMENT
Topic
Name
3+6 =