Python Function Return String Javascript Substring Example