I want to make my own matrix solution code. I having problem when taking values. my code is below:
ask_r = int(raw_input("How many rows: "))
ask_c = int(raw_input("How many columns: "))
"""
[1,2,3]
[3,4,5]
[7,8,9]
"""
"""
matrix = [[1,2,3],[4,5,6],[7,8,9]]
"""
col_m = [0]*ask_c
row_m = [col_m]*ask_r
for i in range(ask_r):
for j in range(ask_c):
val = input("Put in: ")
row_m[i][j] = val
print row_m
What's wrong there as the input changes the value of all the three inner lists(considered as columns).