Push All Array Elements Javascript Substring Function In Python