Commit d79e7887 by BellCodeEditor

auto save

parent cf7bcf3f
Showing with 46 additions and 0 deletions
def new_input():
total = []
while True:
unit = input('请输入(q退出):')
if unit == 'q':
break
else:
try:
unit = int(unit)
except:
print("请重新输入一个数字")
else:
total.append(unit)
finally:
print("=====================")
return total
c=new_input()
print(c)
def func(list):
sum=0
for i in list:
sum=sum+i
return sum
d=func(c)
print(d)
# print("您一共消费了" + str(pay) + "元!扫码还是现金呢?")
# 定义函数:
# def 函数名():
# 函数主体
# 调用函数:
# 函数名()
\ No newline at end of file
def func():
a=3
b=4
return a+b
def func1(a,b):
c=a+b
return c
d=func()
e =func1(3,4)
print(e)
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