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.
>>> l = [4,5,6]
>>> tuple(l)
(4, 5, 6)
>>> tuple="whoops" # Don't do this
>>> tuple(l)
TypeError: 'tuple' object is not callable
More Related Contents:
- Elegant way to perform tuple arithmetic
- Converting string to tuple without splitting characters
- How to sort a dataFrame in python pandas by two or more columns?
- How to remove \xa0 from string in Python?
- How can I selectively escape percent (%) in Python strings?
- Why isn’t my Pandas ‘apply’ function referencing multiple columns working? [closed]
- Python MySQLdb TypeError: not all arguments converted during string formatting
- Split a python list into other “sublists” i.e smaller lists [duplicate]
- UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe2 in position 13: ordinal not in range(128)
- Most pythonic way to interleave two strings
- Python : How to parse the Body from a raw email , given that raw email does not have a “Body” tag or anything
- Transform “list of tuples” into a flat list or a matrix
- Convert RGB color to English color name, like ‘green’ with Python
- How can I do a batch insert into an Oracle database using Python?
- How to run different python versions in cmd [duplicate]
- Permission problems when creating a dir with os.makedirs in Python
- Unable to install sasl-0.1.3 python package on windows machine
- Using Properties in Python classes cause “maximum recursion depth exceeded” [duplicate]
- Screen Capture with OpenCV and Python-2.7
- Why can’t I use a list as a dict key in python? Exactly what can and cannot be used, and why?
- What are the differences between bool() and operator.truth()?
- how to open chrome in incognito mode from Python
- Matplotlib just giving error messages
- Is the right-hand side of an assignment always evaluated before the assignment?
- Why do I get “‘str’ object has no attribute ‘read'” when trying to use `json.load` on a string? [duplicate]
- Catching exception in context manager __enter__()
- confused about random_state in decision tree of scikit learn
- Is possible to mapping view with class using mapper in SqlAlchemy?
- Python 2.7 : LookupError: unknown encoding: cp65001 [duplicate]
- In what case would I use a tuple as a dictionary key? [closed]