Commit 6c645ee7 by BellCodeEditor

save project

parent 6061c309
import func import func
a=func.abc()
print(abc()) print(a)
\ No newline at end of file \ No newline at end of file
list_a = []
def abc(): def abc():
total = []
while True: while True:
try: try:
unit= int(input("请输入:")) unit= int(input("请输入:"))
if unit== 'q': if unit== 'q':
break break
except: except:
print("输入整数")
break break
else: else:
total.append(unit) list_a.append(unit)
return(total) return(sum(list_a))
# print(abc()) \ No newline at end of file
# try:
# age = int(input("你今年几岁了"))
# except:
# print("要输入整数")
# else:
# if age<18:
# print('不可以喝酒')
# print("结束")
# def add():
# x = 5
# y = 9
# print("return之前")
# return x
# print("return之后")
# z = x+y
# a = add()
# print(a)
\ No newline at end of file
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