Python Code For Simple Program Weight