Commit 6b1d4280 by BellCodeEditor

auto save

parent 4b1e2cc0
try:
age = int(input("你今年几岁"))
except:
print('要输入整数')
print("程序结束")
\ No newline at end of file
import func
list1 = func.new_input()
print(func.sum(list1))
def hello(name):
content = "你好" + name
return content
result = hello("小易")
print(result)
def func():
def new_input():
total = []
while True:
try:
......@@ -9,6 +9,14 @@ def func():
total.append(int(unit))
except:
print("只能输入数字或q")
print(total)
return total
func()
def sum(money):
count = 0
for i in money:
count += i
return count
# list1 = new_input()
# result = sum(list1)
# print(result)
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