samedi 31 janvier 2015

Python if-else function: Why does the output ignore the else line [duplicate]


This question already has an answer here:




I'm just learning python and I don't understand why the else line doesn't work.


The output of the script always gives me the if line and not the else line no matter the size of "count" :



def donuts(count):
if count>=10: print 'Number of donuts: many'
else: print 'Number of donuts: ' + `count`
count = raw_input("Number of donuts: ")
donuts(count)
raw_input("press<enter>")

Aucun commentaire:

Enregistrer un commentaire