Commit b76596e7 by BellCodeEditor

save project

parent c4a4b0a7
Showing with 28 additions and 25 deletions
def eat(): # def eat():
total = [] # total = []
while True: # while True:
unit = input("请输入(按q退出):") # unit = input("请输入(按q退出):")
if unit== 'q': # if unit== 'q':
break # break
else: # else:
try: # try:
unit = int(unit) # unit = int(unit)
except: # except:
print("请输入整数") # print("请输入整数")
else: # else:
total.append(unit) # total.append(unit)
finally: # finally:
print("-"*30) # print("-"*30)
return total # return total
def sum(money): # def sum(money):
s = 0 # s = 0
for i in money: # for i in money:
s += i # s += i
return s # return s
z = eat() # z = eat()
a = sum(z) # a = sum(z)
print(a) # print("您总共需要支付",a,"元,请问是现金还是手机支付?")
\ No newline at end of file \ No newline at end of file
import func
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