-4

I have a list of characters; is there a way to print this list such that the list prints without the default square brackets and commas?

For instance:

# this is my list
list = ['a', 'b', 'c']

# this is what I want the output to be
>>>'abc'
wjandrea
  • 28,235
  • 9
  • 60
  • 81
  • At a program level, as the computer operates on a list, what is a list (what "data type" is it? hint: what is a container, and what would it hold?), and what kind of output (what "data type") do you expect? – Joshua Voskamp Mar 10 '23 at 15:06
  • 1
    Do you realize that what you're describing here is *two* different things? First one is a *list* and second *string*. So it's not about *printing*, it's fundamentally you're looking for some other methods to *convert* on thing to other.... Also try to avoid using *built-in* ```list``` as the variable name. – Daniel Hao Mar 10 '23 at 15:06
  • [Formatting help](https://stackoverflow.com/editing-help)... [Formatting sandbox](https://meta.stackexchange.com/questions/3122/formatting-sandbox) – wwii Mar 10 '23 at 15:17
  • Welcome to Stack Overflow! Check out the [tour]. I'm not sure why this question's getting such a bad reception... maybe because it's pretty basic and there's no indication you've tried any research. If you haven't done a Python tutorial, you should do that first, cause this site isn't built to teach the basics. And before posting, you should try your own research; as you can see, similar questions have already been asked. See [How to ask a good question](/help/how-to-ask) for tips like that. – wjandrea Mar 10 '23 at 15:26

1 Answers1

0

You can do this:

print("".join(list))
Berni
  • 36
  • 6