0
tel = {'jack':4098, 'sape':4139}
tel['guido'] = 4127
list(tel)

TypeError Traceback (most recent call last) in () ----> 1 list(tel)

TypeError: 'list' object is not callable

What am doing wrong? Thanks.

2
  • See, there is nothing wrong in the given code snippet. ['jack', 'sape', 'guido'] is the output from the snippet. You must have created a variable name list in your code. Commented Aug 31, 2018 at 15:53
  • just delete the list value. ie del list then run your code Commented Aug 31, 2018 at 16:09

1 Answer 1

2

You must've assigned to list a different value earlier in your IPython session. Restart your IPython session and the same code would work.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer, I had the same trouble in anaconda Python3 environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.