Commit a954242f by BellCodeEditor

save project

parent 26d80e3f
Showing with 12 additions and 5 deletions
...@@ -4,15 +4,22 @@ def new_input(): ...@@ -4,15 +4,22 @@ def new_input():
try: try:
unit= int(input("请输入:")) unit= int(input("请输入:"))
except: except:
print("错了")
else:
if unit== 'q': if unit== 'q':
break break
else:
total.append(unit) else:
total.append(unit)
print(total) print(total)
return total return total
sw=new_input()
a=new_input() def a(ab):
sun=0
for i in ab:
sun=sun+i
return sun
a=a(sw)
print(a) print(a)
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