Skip to content
Advertisement

Convert list to tuple in Python [duplicate]

I’m trying to convert a list to a tuple.

Most solutions on Google offer the following code:

JavaScript

However, the code results in an error message when I run it:

TypeError: ‘tuple’ object is not callable

How can I fix this problem?

Advertisement

Answer

It should work fine. Don’t use tuple, list or other special names as a variable name. It’s probably what’s causing your problem.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement