Commit 37d32ff8 by BellCodeEditor

save project

parent 90104204
Showing with 20 additions and 3 deletions
def func(): def func():
total = [] total = []
while True: while True:
try:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q': if unit== 'q':
break break
else: else:
total.append(int(unit)) total.append(int(unit))
print(total) except:
func() print("只能输入整数或'q'")
\ No newline at end of file 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