Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
You input the yearly salary you want and it breaks down how many pages you need at various rates (25 cents to 30 bucks), it also calculates the number of hours and workdays this would take assuming 20 pages an hour, 7-hour workdays.
rateset = []
addrate = .25
while 30 not in rateset:
rateset.append(addrate)
addrate += .25
print("Test. Printing rateset on next line.")
print(rateset)
while True:
try:
salary = input("Input the yearly salary you would like to make: ")
salary = int(salary)
except:
continue
break
salarystring = str()
newfile = open("PagesCalculation.txt","w")
for i in range(0,len(rateset)):
rate = rateset[i]
pages = salary / rate
pagesstring = str(pages)
ratestring = str(rate)
salarystring = str(salary)
newfile.write("""In order to make $""")
newfile.write(salarystring)
newfile.write(" a year at $")
newfile.write(ratestring)
newfile.write(""" a page:""")
newfile.write("""
""")
newfile.write("You need to complete ")
newfile.write(pagesstring)
newfile.write(" pages a year.")
newfile.write("""
""")
newfile.write("At an average transcription speed of 20 pages an hour, this will take ")
hours = pages / 20
hoursstring = str(hours)
newfile.write(hoursstring)
newfile.write(""" hours, which is the equivalent of """)
workdays = hours / 7
workdaysstring = str(workdays)
newfile.write(workdaysstring)
newfile.write(""" 7-hour work days.
Keep in mind there are only 260 weekdays a year.
******************************
""")
newfile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.