RPSLS program in python