Re: Error .. Please Help

Discussion in 'Python' started by Chris Angelico, Dec 13, 2012.

  1. On Thu, Dec 13, 2012 at 8:23 PM, inshu chauhan <> 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
     
    Chris Angelico, Dec 13, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    564
    Chris Uppal
    May 5, 2005
  2. KK
    Replies:
    2
    Views:
    705
    Big Brian
    Oct 14, 2003
  3. MuZZy
    Replies:
    7
    Views:
    1,821
    Mike Hewson
    Jan 7, 2005
  4. Replies:
    4
    Views:
    337
    Martin Ambuhl
    Nov 14, 2007
  5. mera
    Replies:
    7
    Views:
    1,154
Loading...

Share This Page