Commit d501b18b by BellCodeEditor

save project

parent 5e4d21bc
Showing with 9 additions and 3 deletions
total = []
def a1(): def a1():
total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q': if unit== 'q':
...@@ -12,7 +12,12 @@ def a1(): ...@@ -12,7 +12,12 @@ def a1():
print("int") print("int")
else: else:
total.append(unit) total.append(unit)
return total def a2(list):
j=0
for i in list:
j = i + j
return j
a1() a1()
total=a1()
print(total) print(total)
s=a2(total)
print(s)
\ 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