Commit 6b1fd620 by BellCodeEditor

save project

parent 50e813a9
Showing with 33 additions and 11 deletions
try: def sum(money):
age=int(input('你今年几岁了?')) count=0
except: for i in money:
print('要输入整数哦') count=count+i
else: return count
if age < 18: a=[45,55,65,75,85,95,105,115,125]
print('不可以喝酒哦') print(sum(a))
print('程序结束')
......
...@@ -7,4 +7,29 @@ def a(): ...@@ -7,4 +7,29 @@ def a():
else: else:
total.append(unit) total.append(unit)
print(total) print(total)
a() return(totle)
\ No newline at end of file a()
def sum(money):
count=0
for i in money:
count=count+i
return count
a=[45,55,65,75,85,95,105,115,125]
print(sum(a))
price=a()
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