编写小游戏
开发中的类的继承
import time
import randomclass WeGame(object):def __init__(self, username, sex, boold_num=2000, money=800, agg=0, pre=0):self.username = usernameself.sex = sexself.boold_num = boold_numself.money = moneyself.agg = aggself.pre = preself.room = Noneself.Sword_info = []self.Sword()def Come_game(self):print("答题得金币,题号有【1、2、3】")_num = input("请输入你想答得题目(谨慎选择!!!):")if _num == '1':print("斐波拉契数列的第20位是多少?")tmp1 = input("你的答案:")if tmp1 == '6765':self.money += 600else:self.money += 0print("回答错误,答案是6765")print("你的金币为:", self.money)return self.Sword()elif _num == '2':print("英雄联盟中召唤师峡谷的战役中,双方都分有几个位置?")tmp2 = input("你的答案:")if tmp2 == '5':self.money += 600else:self.money += 0print("回答错误,答案是5")print("你的金币为:", self.money)return self.Sword()elif _num == '3':print("1+1等于几?")tmp3 = input("你的答案:")if tmp3 == '2':self.money += 600else:print("你没救了!")self.money -= 600print("你的金币为:", self.money)return self.Sword()def Sword(self):print('_' * 50)print('*' * 50)print("剑铺:2019/1/13剑铺开张&#