On Thu, Dec 13, 2012 at 8:23 PM, inshu chauhan <insidesh...@gmail.com> wrote: >> Are you really getting floating point values, or are they always going >> to be equal to an integer? Those if/elif statements might be a problem >> if you ever need to compare to a value like (128.4, 255.0, 255.0). > > > I dont have values with decimal part, All values are integer.
Find out how the tuples are actually being given to you. Floating point values are rather annoying when it comes to comparisons. Try printing out one of the tuples; I would hope that it has integer values, not floats, in it. ChrisA -- http://mail.python.org/mailman/listinfo/python-list