mardi 15 septembre 2020

How to check the value of one of the variable from multiple returned values in an IF statement in Python [duplicate]

Does anybody have an idea, how to check the value of a variable a == 0 from an multiple return value function in a single IF statement like below,

if (a, b, c = some_function()) == 0: #currently it is wrong
    ...
    ...
else:
    ...
    ...

def some_function():
    return 0, 123, "hello"

Aucun commentaire:

Enregistrer un commentaire