Not Equal to Each Other?

ale.of.ginger at gmail.com ale.of.ginger at gmail.com
Fri Nov 4 07:30:44 EST 2005


How do I 'define' set?  Is there something to include (like import
random)?

while (choice == 3) and len(set(cellboard[0:8]))==len(cellboard[0:8]):
        # DEFINE TWO RANDOM VARIABLES (ONE FOR ARRAY, ONE FOR NUMBER
VALUE)
        solvingrandom = random.randint(1,9)
        cellboardrandom = random.randint(0,8)
        set(cellboard[0:8])

        # CHECK TO MAKE SURE THE RANDOMLY ASSIGNED CELL DOES NOT HAVE A
VALUE
        if (cellboard[cellboardrandom] is not ('1' or '2' or '3' or '4'
or '5' or '6' or '7' or '8' or '9')):
            cellboard[cellboardrandom] = solvingrandom

The above is my code (right now it will only work for the first row's
numbers).  Anything else I need to add?




More information about the Python-list mailing list