Commit 8879015e by BellCodeEditor

save project

parent f8c2ae87
Showing with 7 additions and 18 deletions
def new_input(): class Hero:
total = [] def__init__(self,name,hp,attack):
while True: self.name=name
unit= input('请输入(q退出):') self.hp=hp
if unit== 'q': self.attack=attack
break def upgrade(self):
else: self.
try:
unit = int(unit)
except:
print('请重新输入一个数字')
else:
total.append(unit)
print('-'*30)
return total
result=new_input()
print(total)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment