所以我的代码不起作用,无论用户使用什么输入,都直接跳到else语句。
start_over = 10
STONKS = raw_input("YESN'T? ")
if raw_input == "What?":
start_over -= 1
print STONKS
elif raw_input == "Yeah?":
print "Nah, don't be a bully Ninja"
start_over -=1
print STONKS
else:
print "YOU ATE MY BEANS?!"
有人可以帮忙吗?
答案 0 :(得分:2)
您需要比较hash = {}
hash.dotkey_set('how.are.you', 'good')
# => "good"
hash
# => {"how"=>{"are"=>{"you"=>"good"}}}
hash.dotkey_set('how.goes.it', 'fine')
# => "fine"
hash
# => {"how"=>{"are"=>{"you"=>"good"}, "goes"=>{"it"=>"fine"}}}
而不是STONKS
raw_input