Commit cedc26e8 by BellCodeEditor

save project

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