Interperter is wrong(bug?)


#1

when i entered my code into the thing, it interpreted it incorrectly. i know this because i checked it against idle and ideone.com.

my code below

diaper = {"front" : "dry", "middle" : "dry", "back" : "dry", 0 : 0}
go_pee = raw_input("pee how much:")
if go_pee == "a little":
    diaper["front"] = "wet"
elif go_pee == "somewhat":
    diaper["front"] = "wet"
    diaper["middle"] = "wet"
elif go_pee == "alot":
    diaper["front"] = "wet"
    diaper["middle"] = "wet"
    diaper["back"] = "wet"
print diaper
wetness = 0
for x in diaper:
    if diaper[x] == "wet":
        wetness += 1
    elif wetness == 1:
        print "1"
        break
    elif wetness == 2:
        print "2"
        break
    elif wetness == 3:
        print "3"
        break
else:
    print "have a potty sticker"

when i ran any of the inputs on it i got the output

pee how much: a little
{'dry': 'back', 0: 0, 'front': 'wet'}
have a potty sticker
None

but when i ran it on ideone and idle i get the correct ouputs

inputting "a little" printed 1, inputting "somewhat" printed 2 ,inputting "alot" printed 3, and anything else printed "have a potty sticker"


#2

What do you think it should print instead? Looks right to me, perhaps you didn't use the same code, perhaps there should be a print and a break for the first case?


#3

i figured out the problem. i had my keys and values on the wrong side.