I believe you got the “per kilowatt hour” concept a bit confused. Looks like instead of dividing the “cost per kilowatt hour” by the “kilowatt hours consumed”, you should be multiplying. E.G.
basecost = float(cost * kilohour)
When I did that, I got what looked to be a nominal bill.
craig@Una:~/Python_Programs/Kilowatt$ python3 Killowatt.py
Enter watts used 10000
Enter Hours of usage 4
Enter your cost of kWh in USD (Example: 0.90 for 90 cents)
.90
Your bill: 38.88
Give that a try.
solved algorithm that outputs the cost of electric bill including tax [closed]