dimanche 24 novembre 2019

Python if vs if-else

Consider the two following codes

print(tuple if tuple == (1,2,3) else tuple())
print(tuple if tuple == (1,2,3))

Output of first one is

()

Output of second one is

(1,2,3)

How are they both different ? Thank you for any help ?

Aucun commentaire:

Enregistrer un commentaire