function object is not subscriptable in python error

technical talkiess
0

 Traceback (most recent call last):

  File "c:\Users\ukv-208\Downloads\prac\python\timemodule.py", line 31, in <module>

    val = list(map(lambda x:x[i],lis_number))

          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "c:\Users\ukv-208\Downloads\prac\python\timemodule.py", line 31, in <lambda>

    val = list(map(lambda x:x[i],lis_number))

                            ~^^^

TypeError: 'function' object is not subscriptable


Solution :- 


Remove the square brackets in the code :- 


val = list(map(lambda x:x(i),lis_number))


Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)