Commit 3fce6c7c by BellCodeEditor

auto save

parent 2261141e
def func(): def func():
resert = 0
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:(按q退出)")
if unit== 'q': if unit== 'q':
break break
else: else:
try: try:
total.append(int(unit)) unit = int(unit)
except: except:
print('要输入整数哦') print('要输入整数哦')
continue continue
print(total) else:
total.append(unit)
finally:
print("*"*30)
for i in total:
resert += i
sumber = print(resert)
return sumber
func() func()
\ No newline at end of file
import func as f
f.func()
\ 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