1

I was working with some lists until I realize a weird behavior. I forgot to put a comma between items of the list. Then I got this:

my_list = ['foo', 'bar' 'xpto', 'qux']
>>> ['foo', 'barxpto', 'qux']

It took so long for me to realize that I forgot to put the comma there because the program doesn't threw any errors. So, why this happened? Why python concatenate the list items instead throwing an exception?

flpn
  • 1,868
  • 2
  • 19
  • 31

0 Answers0