Commit f40d3f2d by BellCodeEditor

save project

parent 7dd6c414
Showing with 10 additions and 10 deletions
......@@ -5,13 +5,13 @@ def new_input():
if unit== 'q':
break
else:
#total.append(unit)
try:
unit=int(unit)
except:
print('请输入一个整数')
else:
total.append(unit)
total.append(unit)
return total
total=new_input()
print(new_input)
\ No newline at end of file
def abc(n):
sum1=0
for i in n:
sum1+=i
return sum1
result=new_input()
pay=abc(result)
print('一共需要',pay,'元')
\ 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