art = list('ABBC')
combination = []
for i in range(3):
combination.append(art)
remove = art.pop(0)
art.append(remove)
Currently breaking down the problem and trying to do using .pop(): ABBC ABCB ACBB
However, when the loop continues and the variable art changes, it also changes the elements within the list too?
So i would want the output to be:
ABBC
ABCB
ACBB
BABC
BACB
BBAC
BBCA
BCAB
BCBA
CABB
CBAB
CBBA
ABBC
And i would like to achieve this without a library?