Advertisement
Guest User

python p1

a guest
Feb 8th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #This program calcualtes the cost of an appliance
  2. #it will calculate the cost of 10 minutes, 1 hour, 1 day
  3. watts = float(input("How many watts does your appliance use:" ))
  4. price = float(input("How much does your power cost in KW/h:"))
  5. while not str(watts):
  6. if not watts:
  7. print("You can not enter no watts.")
  8. watts = float(input("How many watts does your appliance use:")
  9. if str(price) == ("")
  10. float(price) = 8.2 #cents
  11. hour = watts * price
  12. min = ((hour / 60) * 10 # ten minutes
  13. day = hour * 24
  14. print("Your appliance would cost you " + str(min) + " cents for 10 minutes.")
  15. print( str(hour) + " cents for one hour.")
  16. print( str(day) + " cents for one day.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement