lundi 18 juillet 2016

Why does this keep going to the elif block?

Shouldn't it check the first if statement and go to black_room if donate_money = 0 and spend_money is 20?

def white_room():
spend_money = raw_input("How much money have you spent?")
donate_money = raw_input("How much money have you donated?")

if (donate_money <= 0 and spend_money > 10): 
    print "You go to the black room!!"
    black_room()
elif (donate_money > 0 and spend_money > 10):
    print donate_money
    print spend_money
    print "You can stay here..."
    white_room()
else:
    print "You can live in the silver room forever"

Aucun commentaire:

Enregistrer un commentaire