I have the following code:
a=[1,2,3,4]
b=[5,6,7,8]
c=[9,10,11,12]
d=[a,b,c]
print(d)
result=[]
for i in d:
for j in i:
f=j**2
result.append(f)
print(result)
This is the output that i am getting:
[1, 4, 9, 16]
[1, 4, 9, 16, 25, 36, 49, 64]
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144]
This is the output that i want:
[1, 4, 9, 16]
[25, 36, 49, 64]
[81, 100, 121, 144]
I want to use this nested list only to get the desired output.