Hello
In my program i have a matrix the code for which is
test = [ ["x" for x in range(5)] for y in range (5) ]
for y in test:
print " ".join(map(str,y))
which prints something like:
x x x x x
x x x x x
x x x x x
x x x x x
x x x x x
in the program the user inserts numbers in a column with the first input at the bottom and then the next above it and so on.
There are two conditions on which i would like something to be printed.
The first is when a user tries to insert a number in a column that is already full of numbers
eg. when the user tries to insert a number in the first column of the following matrix
1 x x x x
2 x x x x
3 x x x x
4 x x x x
5 x x x x
my current code is
if not x[value][0] == "x":
print "column full"
where 'value' equals the user inputed column.
My second condition is where all the columns have numbers in them.
My code for this one isn't really working at all.
Thanks