Javascript Array And String Problems In Python A Function