Python入门练习“问答闯关游戏设计一”

 

游戏设计:函数if条件判断

问答闯关

from sys import exit

def gold_room():
    print ("This room is full of gold. How much do you take?")
    next = input("> ")
    if "0" in next or "1" in next:
        how_much = int(next)
    else:
        dead("请输入数字:")
    if how_much < 50:
        print( "真棒,你不是贪婪的人!")
        exit(0)
    else:
        dead("你真是贪婪无度!")

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章