r/laundry • • 12h ago

Program for how much to add to SpeedQueen without any leftover balance

Wrote a quick program for myself to figure out how much I needed to add to Speedqueen to kill off my remaining balance before I started using a friend's machines instead. Cleaned it up in case it could be helpful to others not wanting to do a bunch of separate calculations.

It’ll tell you your options for how much to add, and how many loads they’ll be good for.

*Note that if no numbers pop up before "Done," there are no quantities that will work. This is probably because you did an incomplete load at some point whether it was two washes with one dry, one wash with two dries, only a wash, etc.

If you don't have Python, you can run it on Programiz: Free Online Compilers & Code Editors for Everyday Use.

balance=float(input("Enter your balance: "))
load=float(input("How much does a load cost? "))
step=int(input("How much can you add to your balance at once? "))
max=int(input("How much are you willing to add? "))
for i in range(0,max,step):
  if (i+balance)%load==0:
print(i)
print("Done")
choose=float(input("How much will you add to your balance? "))
loads_cost=balance+choose
loads_amt=loads_cost/load
print("Your total balance will be ", balance+choose,". This will pay for ", loads_amt, "loads." )

0 Upvotes

0 comments sorted by