Commit 89ce906d by BellCodeEditor

save project

parent 6d88eca4
Showing with 51 additions and 0 deletions
def func():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
total.append(unit)
print(total)
func()
\ No newline at end of file
try:
age = int(input('w'))
except:
print('y')
print('t')
try:
age = int(input())
except:
print('整数')
else:
if age < 18:
print('no drink')
print('结束')
\ 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('=============================')
return total
def sum(money):
cont = 0
for i in money:
count = count + 1
return count
price = new_input()
pay = sum(price)
print('共'+str(pay)+'元')
\ 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