Javascript How To Loop Over In Python