A Python script that calculates the cost of the electricity that is consumed by an appliance.
Python 3.x
Click the Code button, then click on "Download ZIP"
OR
Click the electricity_cost.py file, then click on the Download Raw File button.
- Enter the appliance's power usage in watts. It must be a positive integer. Then, press Enter.
- Enter the number of usage hours. It must be a positive number, either integer or decimal. Then, press Enter.
- Enter the kw/h price in cents. For example, if the kw/h costs $0.09, simply enter 9. It must be a positive integer. Then, press Enter.
- The electricity cost will be displayed on screen.
- Finally, press Enter to exit the program.
MIT License © 2025 Antonis Paraskevis