for taking list input in the array I used
map(int,input().split())
but for using this input method I can’t modify the array if I Iterated like a[I] then it shows
TypeError: ‘map’ object is not subscriptable
Can you please tell me how can I resolve this problem?
I am a competitive programmer but I am new to python I must have take input array by using map(int,input().split())
>Solution :
Use list(map(int,input().split())) instead of map(int,input().split()) to convert your input to list, because map function returns an generator which can not be indexed.