diff --git a/a.py b/a.py new file mode 100644 index 0000000..cc2568b --- /dev/null +++ b/a.py @@ -0,0 +1,8 @@ +try: + a=int(input('今年几岁了')) +except: + print("请输整数") +else: + if a<18: + print('不能喝酒') + \ No newline at end of file diff --git a/func.py b/func.py new file mode 100644 index 0000000..b61c49b --- /dev/null +++ b/func.py @@ -0,0 +1,15 @@ +s=0 +total = [] +def s_a(): + while True: + unit= input("请输入:") + if unit== 'q': + break + else: + total.append(unit) +s_a() +a=len(total)+1 +for i in range(a): + s=s+i +print(s) + \ No newline at end of file diff --git a/q.py b/q.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/q.py