我有这本字典:
flips_left = {'front flip': True,
'side flip': True,
'back flip': True
}
所有的值都是真
我有这个while循环:
while flips_left[flip_choice] == True:
flip_choice = raw_input("Do a flip ")
if flip_choice in flips_left:
if flips_left[flip_choice]:
print flip_lines[flip_choice]
flips_left[flip_choice] = False
else:
print "You already did a %s" % flip_choice
else:
print "That is not a type of flip"
print "Great! You completed the WOD!"
当dict中的所有值都为false时,我基本上想要一种退出while循环的方法。