Commit a5520f45 by BellCodeEditor

save project

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