Commit 4c6a66a8 by BellCodeEditor

auto save

parent cf552469
import func
a=func.new_input()
b=func.sum(a)
print(b)
\ No newline at end of file
def new_input(): def new_input():
total = [] total = []
while True: while True:
unit= int(input("请输入:")) unit= input("请输入:")
if unit== 'q': if unit== 'q':
break break
else: else:
...@@ -12,4 +11,14 @@ def new_input(): ...@@ -12,4 +11,14 @@ def new_input():
print("滚") print("滚")
else: else:
total.append(unit) total.append(unit)
new_input()
return total
def sum(money):
count = 0
for i in money:
count+=i
return count
#a=new_input()
#g=sum(a)
#print(g)
\ 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