Javascript Create String From Array To Hashmap In Python 3