Algorithm For Control Strctures With Python