Commit 37d32ff8 by BellCodeEditor

save project

parent 90104204
Showing with 28 additions and 11 deletions
def func(): def func():
total = [] total = []
while True: while True:
unit= input("请输入:") try:
if unit== 'q': unit= input("请输入:")
break if unit== 'q':
else: break
total.append(int(unit)) else:
print(total) total.append(int(unit))
func() except:
\ No newline at end of file print("只能输入整数或'q'")
return total
def sum(money):
count = 0
for i in money:
count += i
return count
list1 = func()
result = sum(list1)
print(result)
\ No newline at end of file
def hello(name):
content = "你好" + name
return content
result = hello("小易")
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