while choices:
    l = choices
if last:
    l = [x for x in l if x[0] != last[0] and x[1] != last[1]]
if not l:
    break
newEl = random.choice(l)
last = newEl
shuffle.append(newEl)
choices.remove(newEl)
if not choices:
    print(shuffle)
break
shuffling a list with restrictions in Python