Java String Manipulation Functions Python Return