#!usr/bin/python
# -*-coding:utf-8-*-
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.")
if how_much < 50:
print("Nice, you're not greedy, you win!")
exit(0)
else:
dead("You greedy bastard!")
def bear_room():
print ("There is a bear here.")
print ("The bear has a bunch of honey.")
print ("The fat bear is in front of another door.")
print ("How are you going to move the bear?")
bear_moved = False
while True:
next = input("> ")
if next == "take honey":
dead("The bear looks at you then slaps your face off.")
elif next == "taunt bear" and not bear_moved:
print("The bear has moved from the doo
笨方法学Python 习题 35: 分支和函数
最新推荐文章于 2024-05-15 17:42:25 发布