Javascript String Containing Substring Method Python