mercredi 29 mars 2017

python printing a def function

this might be a silly question but i am a little confused.

class obj:
    def move(x,y,z):
        def on(x,y):
            x = 1
            y = 0 
        if x > y:
            print True
        else:
            print False
        a = on()
        print a

this is my code for a small project i want to start on. however i am unable to print out on() when i compile it, it runs but shows no true or false can i get an explaination why and how i can over come this, thanks :)

Aucun commentaire:

Enregistrer un commentaire