Commit a890f811 by BellCodeEditor

auto save

parent 44b8f173
#导入自己的模块
import func1 import func1
func1.new_input() func1.new_input()
\ No newline at end of file
#自定义函数
def new_input(): def new_input():
sum=0 #求和
total = [] total = []
sum1=0 #总和
while True: while True:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q': if unit== 'q':
...@@ -14,7 +13,6 @@ def new_input(): ...@@ -14,7 +13,6 @@ def new_input():
else: else:
total.append(unit) total.append(unit)
for i in total: for i in total:
sum=sum+i sum1+=i
return sum return sum1
#调用函数
print(new_input()) print(new_input())
\ 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