Hello Stackoverflow community)
Everyone writes that the fastest and most convenient division of a number into digits is the map() function for such a call: map(int, str(123)) (For example, they suggested this solution: Link to a question about this ). Next in that answer, the guy refers to the elements as a list:
print "Happy" if b[0] + b[1] + b[2] == b[3] + b[4] + b[5] else "Unhappy" I do not go so writes the error of the appeal
a = map(int, str(123)) a[1] Traceback (most recent call last): File "<input>", line 1, in <module> TypeError: 'map' object is not subscriptable Tell me what to do? or maybe I'm doing something wrong?