I make a list named scramble. This list is created by randomly adding the values of 2 lists (move1 and move2)
When I print the list, the answer are surrounded by " " or ''.
exemple :
scramble = ['U', 'F2', 'B', 'R2', "U'", 'R', "R'", 'D', 'L2', 'B2', "U'", 'R2', "R'", 'F', "D'"]
my code:
import random as rd
scramble = []
move1 = ["F","R","L","U","B","D"]
move2 = ["","'","2"]
while len(scramble) < 15:
s = move1[rd.randint(0, 5)]
t = move2[rd.randint(0, 2)]
scramble.append(s+t)
I really want to understand why it happens.
and then, correct it.
I suppose that they are several ways to clean the "" and '' after the list is created. But :
- I found that this solution is not optimal.
- I also want that the "move1" is not repeated with the last one. I was planning to work with .startwith but my problem is that ti's sometimes starts with " and sometimes with '.
I finally found the solution. Well, I still don't know why printing the scramble list gave me a mix of " and ' but print(.joint) seems to work.
Thanks to everyone.