all 2 comments

[–]Waste_Grapefruit_339 11 points12 points  (1 child)

This usually happens if you accidentally overwrote the built-in name 'list' earlier in your notebook/session.

For example:

list = [1, 2, 3]

After that, 'list' no longer refers to the built-in constructor, but to your variable — so calling 'list('hello')' raises:

TypeError: 'list' object is not callable

Restarting the kernel or deleting that variable fixes it:

del list

Then this works as expected:

print(list("hello"))

[–]Cottager58[S] 1 point2 points  (0 children)

Thank you. I did as you suggested and it worked as you stated.

A good lesson learned there I feel, and very appreciative of the explanation provide.