Commit d40c7f7d by BellCodeEditor

save project

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