Commit adb85b7c by BellCodeEditor

auto save

parent 7eaed43a
Showing with 37 additions and 0 deletions
try:
age=int(input("几岁了"))
except:
print("整数!")
else:
if age < 18:
print("你不能喝8+1")
print("拜")
\ No newline at end of file
try:
age = int()
\ No newline at end of file
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print("输入价钱")
else:
total.append(unit)
finally:
print("-"*125)
return total
def se(unit):
asd=0
for i in unit:
asd=asd+i
return asd
a=new_input()
s=sum(a)
print("你一共花费了"+str(s)+"元!")
\ No newline at end of file
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