Commit 06e5eef5 by BellCodeEditor

save project

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