Python Forum

Full Version: Different prices per hour
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In a database I have real-time energy data with the consumption (kW) every minute, now I want to apply dynamic prices and thus actually first sum 60 minutes to 1 hour and then the consumption x the right price applies for that hour. Who can help me with this?
The prices are €0,20 € for the first 7 hours of the day, € 0,22 per hour for the hours 7 am – 5 pm and €0,24 for the hours 5 pm – 8 am € and € 0,22 for the hours of 8 pm till 00 am.

How can I best deal with this?
First you should make an effort at writing the code.
Then we will be glad to help where you are having problems.