A
ajikoe
Hello,
Can we impose if then else into list comprehension ?
Like we do in lambda-map form:
This code change None into 0
L = [None, 12]
R = map(lambda x: (x==None and [0] or x)[0], L) # [0,12]
pujo
Can we impose if then else into list comprehension ?
Like we do in lambda-map form:
This code change None into 0
L = [None, 12]
R = map(lambda x: (x==None and [0] or x)[0], L) # [0,12]
pujo