我有一个关于else语句和raw_input语句的问题

时间:2019-06-28 16:07:52

标签: python if-statement

所以我的代码不起作用,无论用户使用什么输入,都直接跳到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?!"

有人可以帮忙吗?

1 个答案:

答案 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