Commit ee94486b by BellCodeEditor

save project

parent cde8889d
Showing with 174 additions and 14 deletions
...@@ -13,5 +13,93 @@ def new_input(): ...@@ -13,5 +13,93 @@ def new_input():
total.append(unit) total.append(unit)
finally: finally:
print("-"*30) print("-"*30)
print(total)
new_input() return total
\ No newline at end of file
abc = new_input()
sum_a = 0
for i in abc:
sum_a=sum_a+i
print(sum_a)
total=[] class hero:
def dsh(): def_init_(self):
while True: self.level=1
unit=input("请输入:") self.hp=300
if unit=='q': self.attack=20
break
else: yase=Hero()
total.append(unit) print(yase.level)
dsh() print("yase的血量值为:",yase.hp)
print(total) print("yase的攻击力为:",yase.attack)
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