I want to transform the list ["A","B","A","A","B"] to the list ["AB","BA","AA","AB"].
I have tried to define a new list in which the first element is deleted and then add the strings of the lists together. After which I plan to delete the last element of the new list to get the result.
lista = sequences
lista.pop(0)
print(lista)
for x in range(sequences):
mc =sequences[x]+lista[x]
Run Code Online (Sandbox Code Playgroud)
But all I get is
TypeError: 'list' object cannot be interpreted as an integer
Any help …