Im pretty new to Python aswell, but I do know that you just have to have two bars that are animated with scale so they are full at the first frame and empty on the last, then just make the properties for the bars.
A “simple” health bar can be done without Python, and if you don’t know what you’re doing with python, maybe you should try plain logicbricks.
The general idea is to have a bar that has an animation that scales itself from zero health to full health. Then you can use the IPO actuator to control that bar’s size with a property (Play Property). You can have it copy the health attribute from your player with the property actuator.
I made a little demo (plus a minigame!) to demonstrate this. You really should only have to look at the health bar to see how this is all done.