why it says str not callable?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nilushika
    New Member
    • Sep 2013
    • 20

    why it says str not callable?

    Code:
    >>> li=[4,5]
    >>> map(str,li)
    
    Traceback (most recent call last):
      File "<pyshell#1>", line 1, in <module>
        map(str,li)
    TypeError: 'str' object is not callable
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    You have used 'str' as an identifier which masks the built in type. Delete the identifier.
    Code:
    del str

    Comment

    Working...