NP python problem