DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
else statement python list comprehension
>>> [a if a else 2 for a in [0,1,0,3]] [2, 1, 2, 3]
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#statement
#python
#list
#comprehension
ADD COMMENT
Topic
COMMENT
Name
8+7 =
Submit