Answer the question
In order to leave comments, you need to log in
How to insert the only value of a list without brackets?
A list is formed, it can contain only one value. When inserting using the method join()
, extra elements appear:
numbers = [3]
print(', '.join(numbers)
[, 3, ]
Answer the question
In order to leave comments, you need to log in
print(', '.join(map(str, filter(bool, numbers))))
if i understand the problem correctly
The given code is syntactically incorrect, and should not give such behavior.
So what you launch is not what you bring here.
How do you declare a list?
Isn't
numbers = "[3]" a case?
Or maybe
numbers = input() #type [3]
Because in that case, the observed behavior will be exactly what you describe.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question