Commit 578cde14 by BellCodeEditor

save project

parent 94884c9f
Showing with 33 additions and 7 deletions
......@@ -15,14 +15,15 @@ print("宇智波佩奇的品质为:SSR")
print("后羿的品质为:B")
def upgrade():
yuzhibopeiqi.level = self.level + 1
yuzhibopeiqi.hp = self.hp + 50
yuzhibopeiqi.attack = self.attack + 5
upgrade()
print(yuzhibopeiqi,attack,yuzhibopeiqi,hp,yuzhibopeiqi,level)
print
self.level = self.level + 1
self.hp = self.hp + 50
self.attack = self.attack + 5
print("宇智波佩奇的血量为:",yase.hp)
yuzhibopeiqi = Hero('宇智波佩奇',200,50)
yuzhibopeiqi = Hero(houyi,200,50)
print(yuzhibopeiqi.attack,yuzhibopeiqi.hp,yuzhibopeiqi.level)
print("宇智波佩奇的血量为:",yuzhibopeiqi.hp)
print("后羿的血量为:", houyi.hp)
......
函数返回值U4答案
def new_input():
    total = []
    while True:
        unit= input('请输入(q退出):')
        if unit == 'q':
            break
        else:
            try:
                money = int(money)
            except:
                print("请重新输入一个数字")
            else:
                total.append(money)
            finally:
                print("-"*30)
    return total
def sum(money):
    count = 0
    for i in money:
        count = count + i
    return count
price = new_input()
pay=sum(price)
print("您一共消费了"+str(pay)+"元!扫码还是现金呢?")
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