Commit d40c7f7d by BellCodeEditor

save project

parent 688d7528
Showing with 9 additions and 2 deletions
......@@ -7,7 +7,7 @@ def a_1():
break
else:
try:
unit1=int(unit)
unit=int(unit)
except:
print('输入错误,请重新输入一个数字')
else:
......@@ -15,5 +15,12 @@ def a_1():
print("-"*30)
print(total)
return total
def count(unit):
z=0
for i in unit:
z=z+i
return z
a_1()
price=a_1()
pay=count(price)
print('总价格'+str(pay)+'元')
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