Commit 3607feea by BellCodeEditor

auto save

parent f89ed261
Showing with 33 additions and 19 deletions
total = [] def new_input():
while True: total = []
unit= input("请输入:") while True:
if unit== 'q': unit=input("请输入:")
break if unit== 'q':
else: break
total.append(unit) else:
print(total) try:
\ No newline at end of file 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)
def new_input(): def new_input():
total = [] total = []
while True: while True:
try: unit=input("请输入:")
unit=int(input("请输入:")) if unit== 'q':
except:
#if unit== 'q':
break break
else: else:
total.append(unit) try:
return total unit=int(unit)
print(total) except:
new_input() unit= input("请输入:")
s=new_input() else:
\ No newline at end of file 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
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