Javascript Loop Through Array And Strings In Python