samedi 23 janvier 2021

i do not understand the usage of the first not true statement in the first line of code?

i didnt understood the purpose of first not true statement as i understand that
if proceeds with statement if it is deemed true but in the following sceanrio shouldn't code return out no results ?
p.s. i am just learning python for the first time and
would appreciate your valuable time and help

if not True:
   print("1")
elif not (1 + 1 == 3):
   print("2")
else:
   print("3")

the output of the following code turns out to be 2 i dont understand how?

Aucun commentaire:

Enregistrer un commentaire