Question: I have a list of tuples. I want to pick each and every tuple in the list and compare it with another tuple which is defined by me. 

The code that i used is as follows;

```
list1 = [(3, 4), (4, 5), (5, 6)]
for item in list1:
   if list1[item] == (4,5)
      print ("OK")

```

but it says that list indices must be an integer or slice. If i want to take each tuple in the list and compare them against another, how should i code it?

please help me!

Answer: 
try this:

```
list1 = [(3, 4), (4, 5), (5, 6)]
for item in list1:
    if item == (4,5):
        print ("OK")

```
you can achieve it the following way.. 

```
list1 = [(3, 4), (4, 5), (5, 6)]
for item in range(len(list1)):
    if list1[item] == (4,5):
        print ("OK")
    else:
        continue

```