lundi 26 avril 2021

What does the python if else statement in the code mean here? [duplicate]

hey = 9
ley = list()
ley.append(3)
ji=2
kund=(7*((hey - ley[-1]-1) if hey else ji))
print(kund)
#35 is the output 

*Here if you see , i have used if hey else ji , which according to me should mean that if hey has some value then it should return ji . Am i correct ? can someone correct me with this one *

Aucun commentaire:

Enregistrer un commentaire