diff --git a/__pycache__/func.cpython-37.pyc b/__pycache__/func.cpython-37.pyc new file mode 100644 index 0000000..0ed192a Binary files /dev/null and b/__pycache__/func.cpython-37.pyc differ diff --git a/func.py b/func.py index 5bdbdbe..888c0a6 100644 --- a/func.py +++ b/func.py @@ -15,13 +15,13 @@ def new_input(): total.append(y) finally: print("-"*30) - - print(total) + + return total -new_input() + def sum(c): f=0 - for i in c(): + for i in c: f=f+i - print("一共消费"+int(f)+"元!扫码还是现金呢" -return f + # print("一共消费"+str(f)+"元!扫码还是现金呢") + return f diff --git a/swim.py b/swim.py new file mode 100644 index 0000000..22e7046 --- /dev/null +++ b/swim.py @@ -0,0 +1,4 @@ +import func +x=func.new_input() +u=func.sum(x) +print("总分为"+str(u)) \ No newline at end of file