From b35c08a09e25bab63039bace4b61213576117a83 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Mon, 26 Jul 2021 16:44:12 +0800 Subject: [PATCH] save project --- func.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 func.py diff --git a/func.py b/func.py new file mode 100644 index 0000000..b02d5cb --- /dev/null +++ b/func.py @@ -0,0 +1,27 @@ +total = [] +x = 0 +def diancai(): + while True: + unit= input("请输入:") + if unit== 'q': + break + else: + try: + total.append(int(unit)) + except: + print('请输入数字哦') + else: + print('添加成功') + return total +def sum(): + o = 0 + for i in x: + o = o + i + return o +x = diancai() +w = sum() +diancai() +sum() +print('您一共消费了' + str(w) + '元!扫码还是现金呢?') + + -- libgit2 0.25.0