Commit 5c51c988 by BellCodeEditor

auto save

parent c7ce0a88
def func1():
list=[]
while True:
a=input("输入")
list.append(int(a))
if(a=='q'):
break
return list
a=func1()
def func2(list):
sum=0
\ No newline at end of file
...@@ -11,21 +11,19 @@ def new_input(): ...@@ -11,21 +11,19 @@ def new_input():
print("请重新输入一个数字") print("请重新输入一个数字")
else: else:
total.append(unit) total.append(unit)
finally:
print("=====================")
return total return total
c=new_input() # c=new_input()
print(c) # print(c)
def func(list): def func(list):
sum=0 sum=0
for i in list: for i in list:
sum=sum+i sum=sum+i
return sum return sum
d=func(c) # d=func(c)
print(d) # print(d)
# print("您一共消费了" + str(pay) + "元!扫码还是现金呢?") # print("您一共消费了" + str(d) + "元!扫码还是现金呢?")
# 定义函数: # 定义函数:
# def 函数名(): # def 函数名():
......
...@@ -5,6 +5,6 @@ def func(): ...@@ -5,6 +5,6 @@ def func():
def func1(a,b): def func1(a,b):
c=a+b c=a+b
return c return c
d=func() def func2(c):
e =func1(3,4) return c
print(e) print(1111)
import test,test1
# n=test.new_input()
# m=test.func(n)
# print("分数为"+str(m)+"分")
a=test1.func()
b=test1.func1(a,5)
c=test1.func2(b)
print(a,b,c)
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