Commit 6c645ee7 by BellCodeEditor

save project

parent 6061c309
import func
print(abc())
\ No newline at end of file
a=func.abc()
print(a)
\ No newline at end of file
list_a = []
def abc():
total = []
while True:
try:
unit= int(input("请输入:"))
if unit== 'q':
break
except:
print("输入整数")
break
else:
total.append(unit)
return(total)
# print(abc())
# 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
list_a.append(unit)
return(sum(list_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