Это работает:
allDasTickets = ["9255955", "9255958", "9255960", "9255977"]
[[j for j in allDasTickets if x != j] for x in allDasTickets]
['9255958', '9255960', '9255977']
['9255955', '9255958', '9255977']
['9255958', '9255960', '9255977']
['9255955', '9255958', '9255960']
Но это не так:
allDasTickets = ["9255955", "9255958", "9255960", "9255977"]
[for x in allDasTickets [j for j in allDasTickets if x != j]]
File "<stdin>", line 1
[for x in allDasTickets [j for j in allDasTickets if x != j]]
^