Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This program calcualtes the cost of an appliance
- #it will calculate the cost of 10 minutes, 1 hour, 1 day
- watts = float(input("How many watts does your appliance use:" ))
- price = float(input("How much does your power cost in KW/h:"))
- while not str(watts):
- if not watts:
- print("You can not enter no watts.")
- watts = float(input("How many watts does your appliance use:")
- if str(price) == ("")
- float(price) = 8.2 #cents
- hour = watts * price
- min = ((hour / 60) * 10 # ten minutes
- day = hour * 24
- print("Your appliance would cost you " + str(min) + " cents for 10 minutes.")
- print( str(hour) + " cents for one hour.")
- print( str(day) + " cents for one day.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement