2 odpowiedzi
+ 11
l = [
[1,2,3],
[4,5,6],
[7,8,9],
]
n = [[j+0.1 for j in i] for i in l]
It might be easier to use a numpy array though:
https://code.sololearn.com/c9ySLRIO8yFY/?ref=app
+ 1
Oh okay. So the trick was to loop over row in the outer for loop and column in the inside. I used to get error saying inner iterator variable isn't declared. Great help ! Thank you. Solved my problem.