# coding:utf-8
# ex35 分支和函数
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("Man, learn to type a number.")
#新增的判断,使用try当int()报错时,提示输入错误,否则进入对数字大小的判断
try:
how_much = int(next)
except:
dead("Wrong input.")
if how_much < 50
练习35——分支和函数
最新推荐文章于 2021-05-20 02:44:01 发布