Python Loop Over String Javascript Program Interview