Commit a5520f45 by BellCodeEditor

save project

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