[BangPypers] Iterating list of tuples

Anand Chitipothu anandology at gmail.com
Mon Jul 4 08:32:12 CEST 2011


2011/7/4 Asif Jamadar <asif.jamadar at rezayat.net>:
> Suppose I have list of tuples
>
> data = [
>    (10, 25, 18, 17, 10, 12, 26, 5),
>    ]
>
> for value in data:
>     if data[value]>5:
>                print " greater"
>    else:
>       print "lesser"
>
> But the code giving me error so can I know how iterate list of tuples?

What is the error you are getting? It looks like you are using
different indentation for if part and else part.

Anand


More information about the BangPypers mailing list