Mac上有内置python2.7我又下载的3.74
下面两个py文件,simple game import games
问题是不报错也不显示,请大神求解!!!
# Game
# 演示模块的创建
class Player(object):
""" A player for a game."""
def __init__(self, name, score = 0):
self.name = name
self.score = score
def __str__(self):
rep = self.name + ":\t" + str(self.score)
return rep
def ask_yes_no(question):
"""Ask a yes or no question."""
response = None
while response not in ("y", "n"):
response = input(question).lower()
return response
def ask_number(question, low, high):
"""Ask for a number within a range."""
response = None
while response not in range(low, high)