mercredi 17 juillet 2019

What does Python regard as "true"?

In if statements you obviously have:

if [statement]:
    [Action]

For the "statement" part, what do you need to put there to make it not pass, for example, will this print "Hello, World!":

if []:
    print("Hello, World!")

or

if "Will this pass?":
    print("Hello, World!")

Aucun commentaire:

Enregistrer un commentaire