I am trying to extend an element to a list in Python, however, instead of extending the string in the index 'i' it extends every character of the string in the index 'i'.
For example I have a list called 'strings' with just a string 'string1' and an empty list called 'final_list'.
I want to extend the first element of 'strings' to the 'final_list', so I do final_list.extend(strings[0])
. But instead of the 'final_list' to end with a length of 1, corresponding to the string inserted, the list ends up with a length of 7.
If it helps, this is my code:
con = connect()
i = 0
new_files = []
while i < len(files):
info_file = obter_info(con, files[i])
if info_file [5] == 0: #file not processed
new_files.append(files[i])
i += 1
Does anyone know how can I make this to work?