Commit 06e5eef5 by BellCodeEditor

save project

parent f776c992
Showing with 13 additions and 4 deletions
def new_input():
j=[]
a=0
while True:
unit=input("请问你要什么?")
unit=input("请输入数字")
if unit=="q":
break
else:
j.append(unit)
\ No newline at end of file
try:
b=int(unit)
except:
print("请输入整字")
else:
a=a+b
#print(a)
return a
c=new_input()
print(c)
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