Can someone point out why I am getting this error? It seems the error occur when len(freqsetlist) is > 1. That is when calculating tuple with 3 element
Answer
That is the representation of the object, if you want a different representation, you will have to construct it yourself:
>>> k = ['van']
>>> "({})".format(", ".join(k))
'(van)'
Note that this implies you are using Python's representation of an object as a part of your program, this is a bad idea, and you should always construct what you need manually rather than try and use Python's representation, which is intended for debugging.
Edit: The comma is Python's way of showing it's a tuple, as brackets signify grouping of operations rather than tuples by default. You could make your own tuple subclass and change the __repr__()/__str__() if you really wanted, but that would be incredibly pointless (and unpythonic in the case of __repr__() as it should evaluate to the object).
Hello my assignment is :Create a system that allows the user to enter their name, title, surname, Dob, email and phone number. Once details are submitted, they should be written to a file. Surnames tha…
I am a beginner and I am stuck on this problem, "Write a python code that uses a while loop to print even numbers from 2 through 100. Hint ConsecutiveEven differ by 2."Here is what I came up …
I am new and learning python 3.6 and Ive almost completed my first code project. After doing an exhaustive search to resolve my problem I have not been able to find the answer to what I am sure is a si…
Closed. This question needs to be more focused. It is not currently accepting answers.Want to improve this question? Update the question so it focuses on one problem only by editing this post.Closed 5…
I have two lists:a - dictionary which contains keywords such as ["impeccable", "obvious", "fantastic", "evident"] as elements of the listb - sentences which cont…
Closed. This question needs to be more focused. It is not currently accepting answers.Want to improve this question? Update the question so it focuses on one problem only by editing this post.Closed 2…
Closed. This question needs details or clarity. It is not currently accepting answers.Want to improve this question? Add details and clarify the problem by editing this post.Closed 7 years ago.Improve…
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable…
Here is my code:def numbers_in_lists(string):num = int(string)l = list(num)return lstring = 543987When i run it:print numbers_in_lists(string)I have the following error:l = list(num)
TypeError: int obj…