Commit 493fee0f by BellCodeEditor

save project

parent 3607feea
Showing with 10 additions and 26 deletions
def new_input():
total = []
while True:
unit=input("请输入:")
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
unit= input("请输入:")
else:
total.append(unit)
return total
a=new_input()
for i in range(lan(a)):
sum+=a[i]
print(sum)
print(total)
\ No newline at end of file
......@@ -5,14 +5,8 @@ def new_input():
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
unit= input("请输入:")
else:
int(unit)
total.append(unit)
return total
a=new_input()
for i in range(lan(a)):
sum+=a[i]
print(sum)
\ No newline at end of file
print(total)
while True:
new_input()
\ 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