mercredi 15 juin 2016

if and else in python lambda expression

Please help me to understand how this works. Output is 4

a=4
b=7

x=lambda: a if 1 else b
lambda x: 'big' if x > 100 else 'small'
print(x())

Aucun commentaire:

Enregistrer un commentaire