I have a question about the difference between list += ‘string’ and list +=[‘string’]. I mistook input a command in Python as:
Completedlist = []
Completedlist += ‘bob’
Which will return:
['b', 'o', 'b']
I am not quite sure about why this happens. Besides, is there any difference between += and append in this scenario? I mean between completedlist.append(‘bob’) and completedlist += [‘bob’]. Thank you in advance for your help.