By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,516 Members | 845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,516 IT Pros & Developers. It's quick & easy.

why it says str not callable?

P: 20
Expand|Select|Wrap|Line Numbers
  1. >>> li=[4,5]
  2. >>> map(str,li)
  4. Traceback (most recent call last):
  5.   File "<pyshell#1>", line 1, in <module>
  6.     map(str,li)
  7. TypeError: 'str' object is not callable
May 31 '14 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 2.5K+
P: 2,851
You have used 'str' as an identifier which masks the built in type. Delete the identifier.
Expand|Select|Wrap|Line Numbers
  1. del str
May 31 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.