OK.
If you just want to know how to implement seg tree in python then you can see this for normal implementation (recursive) which is commonly followed.

The implementation in the above post uses iterative approach and you can read this to understand it.