Is this a bug? I don't know where to start

Discussion in 'Python' started by jim bardin, Jun 23, 2005.

  1. jim bardin

    jim bardin Guest

    jim bardin, Jun 23, 2005
    #1
    1. Advertising

  2. jim bardin wrote:
    > Is this a python bug, or do i not understand
    > something?
    >
    > http://www.linuxquestions.org/questions/showthread.php?s=&threadid=336118
    >
    > It seems to me that this should output each value
    > once, but i get some seemingly random duplicates.


    Your targets contains duplicates - and these produce the problem. And as

    >>> print len(all) == len(set(all))

    False

    shows your alleged " i checked the output of the combination generator
    and they're all unique values." is obvously wrong.

    Doing this

    targets=list(set([97,101,139,41,37,31,29,89,23,19,8,13,131,19,73,97,19,139,79,67,61,17,113,127]))


    as first line solves the problem.


    Diez
     
    Diez B. Roggisch, Jun 23, 2005
    #2
    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. DP
    Replies:
    0
    Views:
    1,156
  2. David
    Replies:
    2
    Views:
    334
    Steve C. Orr [MVP, MCSD]
    Dec 17, 2004
  3. dbsruddktkkf

    I don't know where to start

    dbsruddktkkf, Jul 17, 2010, in forum: C Programming
    Replies:
    0
    Views:
    360
    dbsruddktkkf
    Jul 17, 2010
  4. jeantoe
    Replies:
    0
    Views:
    473
    jeantoe
    Oct 4, 2010
  5. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    253
    Gregory Toomey
    Apr 23, 2004
Loading...

Share This Page