You need to sign in or sign up before continuing.
Commit a7d196e6 by BellCodeEditor

save project

parent dc70412a
Showing with 32 additions and 0 deletions
try:
age = int(input('你今年几岁了'))
except:
print('输入整数')
print('程序结束')
\ No newline at end of file
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit11 = int(unit)
except:
print('输入数字')
else:
total.append(unit11)
return total
print(total)
x=new_input()
def and_new(total):
w=0
for i in total:
w=w+i
return w
p=and_new(x)
print(p)
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