Commit 8879015e by BellCodeEditor

save project

parent f8c2ae87
Showing with 7 additions and 18 deletions
def new_input():
total = []
while True:
unit= input('请输入(q退出):')
if unit== 'q':
break
else:
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
class Hero:
def__init__(self,name,hp,attack):
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
self.
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