I am trying to write a Suduoku game. Every time I use a
number, I need to delete it from the list.
I
have already tried .pop[1]
, but it did nothing when the number
was one.
import
random
rownum1 =
["1","2","3","4","5","6","7","8","9"]
print(random.choice(rownum1))
if
random.choice(rownum1) == "1":
del rownum1[0]
print(rownum1)
If one
is randomly selected I expect the output to
be:
["2","3","4","5","6","7","8","9"]
But
nothing is happening when one is randomly chose.
No comments:
Post a Comment