用于平衡直到不工作的Python脚本

时间:2016-08-29 07:53:02

标签: python

想出疯狂的价值......试图通过输入账单,硬币数量,轻松地在工作中平衡收费。

任何人都对错误有任何见解?

#End of day till count simplified
myfile = open('Endofdaycount.txt', 'w')
hundreds = 100
fiftes = 50
twenties = 20
tens = 10
fives = 5
ones = 1
quarters = .25
dimes = .10
nickels = .05
pennies = .01
rollofquarters = 10
rollofdimes = 5
rollofnickels = 2
rollofpennies = .50

prompt1 = input ("How many hundreds are in the till?") + str(hundreds)
prompt2 = input ("How many fiftes are in the till?") + str(fiftes)
prompt3 = input ("How many twenties are in the till?") + str(twenties)
prompt4 = input ("How many tens are in the till?") + str(tens)
prompt5 = input ("How many fives are in the till?") + str(fives) 
prompt6 = input ("How many ones are in the till?") + str(ones)
prompt7 = input ("How many quarters are in the till?") + str(quarters)
prompt8 = input ("How many dimes are in the till?") + str(dimes)
prompt9 = input ("How many nickels are in the till?") + str(nickels)
prompt10 = input ("How many pennies are in the till?") + str(pennies)
prompt11 = input ("How many rolls of quarters are in the till?") + str(rollofquarters)
prompt12 = input ("How many rolls of dimes are in the till?") + str(rollofdimes)
prompt13 = input ("How many rolls of nickles are in the till?") + str(rollofnickels)
prompt14 = input ("How many rolls of pennies are in the till?") + str(rollofpennies)
total = str(prompt1 + prompt2 + prompt3 + prompt4 + prompt5 + prompt6 + prompt7 + prompt8 + prompt9 + prompt10 +prompt11 +prompt12 +prompt13 +prompt14)
myfile.close()
print (total)

0 个答案:

没有答案