Feb-03-2020, 08:38 PM
With f-string and in Python is better to us snake_case PEP-8.
wattage = float(input("What is the wattage of your device?")) hours_used = float(input("What is the amount of hours used?")) price_per_kWh = 11.76 electricity_cost = (wattage*hours_used) / (1000*price_per_kWh) print(f"The cost of electricity is: {electricity_cost:.2f}")