Commit bdc7b8f5 by BellCodeEditor

auto save

parent d8b74301
Showing with 2 additions and 26 deletions
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit = int(unit)
except:
print("请输入整数!")
else:
total.append(unit)
return total
a = new_input()
def money(x):
k=0
for i in range(len(x)):
k = k + x[i]
return k
b = money(a)
print(b)
\ No newline at end of file
open('C:\\Users\\EDZ\\Desktop\\haha\\text.py','w',encoding='utf-8')
\ 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