Commit a5520f45 by BellCodeEditor

save project

parent 9acadbc7
Showing with 30 additions and 11 deletions
total = [] def new_input():
while True: total = []
unit= input("请输入:") while True:
if unit== 'q': try:
break unit= input("请输入:")
else: if unit=="q":
total.append(unit) break
print(total) else:
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 = new_input()
result = sum(list1)
print(result)
\ No newline at end of file
def hello(name):
content = "你好" + name
return content
result = hello("小一")
print(result)
\ 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