diff --git a/__pycache__/diy1.cpython-37.pyc b/__pycache__/diy1.cpython-37.pyc new file mode 100644 index 0000000..4bbb73b Binary files /dev/null and b/__pycache__/diy1.cpython-37.pyc differ diff --git a/__pycache__/func.cpython-37.pyc b/__pycache__/func.cpython-37.pyc new file mode 100644 index 0000000..55bd756 Binary files /dev/null and b/__pycache__/func.cpython-37.pyc differ diff --git a/diy1.py b/diy1.py new file mode 100644 index 0000000..3742b93 --- /dev/null +++ b/diy1.py @@ -0,0 +1,8 @@ + +def sum(money): + count=0 + for i in money: + count=count+i + print(count) + return count + diff --git a/diy666.py b/diy666.py new file mode 100644 index 0000000..7b6e4b9 --- /dev/null +++ b/diy666.py @@ -0,0 +1,13 @@ +try: + age = int(input('你今年几岁了?')) +except: + print('要输入整数啊') +else: + if age < 18: + print('不可以喝酒噢') +print('程序结束~~') + + + + + diff --git a/func.py b/func.py new file mode 100644 index 0000000..adbe90f --- /dev/null +++ b/func.py @@ -0,0 +1,10 @@ +def new_input(): + total = [] + while True: + unit= input("请输入:") + if unit== 'q': + break + else: + total.append(unit) + return total +new_input() diff --git a/swim.py b/swim.py new file mode 100644 index 0000000..64d8857 --- /dev/null +++ b/swim.py @@ -0,0 +1,5 @@ +import func +import diy1 +swim=func.new_input() +diy1=func.sum(swim) +print("jhffg") \ No newline at end of file