mercredi 5 septembre 2018

New to Python, please what is wrong with my statement?

Python says that If self.age > 50 that statement appears to have no effect

def favoriteColor(self): ##self.color = favorite_color #Determine color depending on age

    If self.age > 50  
    self.color = "blue"

    elif self.age > 10 and self.age < 20
    self.color = "green"

    elif self.age < 10
    self.color = "red"
    return 

Aucun commentaire:

Enregistrer un commentaire