And list is defined as like list1={tuple1,tuple2,.........}
tuple1=(x,2,5,6}..

Again, you use {...} as if you were defining a set instead of a list. Tuples are hashable and can be used in a set, but in your original code you had [...] instead of (...), i.e., lists instead of tuples.

But since both my guesses were correct, the code I provided should work, right?