Commit 4be7a139 by BellCodeEditor

save project

parent c5af360b
Showing with 11 additions and 12 deletions
try: import func
age = int(input('你今年几岁了')) data=func.er()
except: ty=func.ert(data)
print('要数') print("成绩为:"+str(ty))
print('~~~~~') \ No newline at end of file
\ No newline at end of file
...@@ -15,7 +15,7 @@ def er(): ...@@ -15,7 +15,7 @@ def er():
total.append(unit) total.append(unit)
print(total) print(total)
return total return total
price=er() # price=er()
def ert(price): def ert(price):
sum=0 sum=0
for i in price: for i in price:
...@@ -24,11 +24,11 @@ def ert(price): ...@@ -24,11 +24,11 @@ def ert(price):
print("==========================================") # print("==========================================")
print(price) # print(price)
print('我下面开始计算菜单的总价') # print('我下面开始计算菜单的总价')
su=ert(price) #su=ert(price)
print('菜单的总价格为:'+str(su)) # print('菜单的总价格为:'+str(su))
# ''' # '''
# 思路: # 思路:
# 遍历得到列表中的每个值,然后让他们相加 # 遍历得到列表中的每个值,然后让他们相加
......
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