Commit 6b1fd620 by BellCodeEditor

save project

parent 50e813a9
Showing with 33 additions and 11 deletions
try:
age=int(input('你今年几岁了?'))
except:
print('要输入整数哦')
else:
if age < 18:
print('不可以喝酒哦')
print('程序结束')
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))
......
......@@ -7,4 +7,29 @@ def a():
else:
total.append(unit)
print(total)
a()
\ No newline at end of file
return(totle)
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