jeudi 1 juin 2017

How to go from an if then statement to a function in python [on hold]

So my code basically is as follows:

if (thing == "oneanswer"):   
    print("reflection on choice")   
    differentfunction()
elif (thing == "otheranswer"):
    anotherdifferentfunction()

and I just want to know if this is actually possible and if you can load a function from an if else statement within another.

Aucun commentaire:

Enregistrer un commentaire