Commit cedc26e8 by BellCodeEditor

save project

parent ab65305d
Showing with 23 additions and 8 deletions
......@@ -5,6 +5,22 @@ def ne():
if unit== 'q':
break
else:
total.append(unit)
print(total)
ne()
\ No newline at end of file
try:
unit=int(unit)
except:
print('要输入整数啊')
else:
total.append(unit)
return total
def sum(unit):
c=0
for i in unit:
c=c+i
return c
unit=ne()
pay=sum(unit)
print("需要支付"+str(pay)+"元")
try:
age = int(input('你今年几岁了?'))
except:
print('要输入整数啊')
print('程序结束')
\ No newline at end of file
print('程序结束')except:
print('要输入整数啊')
\ 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