Commit a9f1d397 by BellCodeEditor

save project

parent b830784b
Showing with 8 additions and 13 deletions
def new_input(): def new_input():
total = [] total = []
while True: while True:
money= input("请输入:") unit= input("请输入:")
if money == 'q': if unit== 'q':
break break
else: else:
try: try:
money=int(money) unit=int(unit)
except: except:
print("应输入整数") print("应输入整数")
else: else:
total.append(money) total.append(unit)
new_unit=int(unit)
return total return total
def abc(list1): list1=new_input()
count=0 print(list1)
for i in range(list1): \ No newline at end of file
count+= i
return count
result=new_input()
pay=abc(result)
print("一共需要付",pay,"元")
\ 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