Commit 153cd776 by BellCodeEditor

save project

parent ceb03199
Showing with 10 additions and 33 deletions
class hero:
def a(): def __init__(self):
total = [] self.level=(1)
while True: self.hp=(300)
unit= input("请输入:") self.attack=(20)
if unit== 'q': yase=hero()
break print("垭瑟的攻击力",yase.attack)
else: \ No newline at end of file
total.append(unit)
print(total)
a()
\ No newline at end of file
def new_input(): print()
total = [] \ No newline at end of file
while True:
money = input('请输入(q退出):')
if money == 'q':
break
else:
try:
money = int(money)
except:
print("请重新输入一个数字")
else:
total.append(money)
finally:
print("-"*30)
return total
result = new_input()
print(result)
\ 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