Commit 5dd3f9da by BellCodeEditor

save project

parent 4531e868
Showing with 16 additions and 2 deletions
price=[15,18,14,25]
count=0
def qiuhe(price):
count = 0
for i in price:
count = count+i
return count
a=[10,20,30,40]
s=qiuhe(price)
n=qiuhe(a)
print(s)
print(n)
\ No newline at end of file
...@@ -12,8 +12,9 @@ def new_input(): #定义函数new_input() ...@@ -12,8 +12,9 @@ def new_input(): #定义函数new_input()
break #中止循环 break #中止循环
#print(total) #输出total列表的全部元素 #print(total) #输出total列表的全部元素
print('-'*30) #输出30个下划线'_' print('-'*30) #输出30个下划线'_'
return total
new_input() #调用函数new_input t=new_input() #调用函数new_input()
print(t)
......
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