What have you tried so far?
I only know how to work this way I tried to understand the numpy library more without success.
l = int (input ())
opera = input ()
m = []
for i in range (12):
m.append ([])
for i in range (12):
for j in range (12):
x = float (input ())
m [i] .append (x)
if opera == 'S':
sum = 0
for k in m [l]:
sum = sum + k
print (sum)
if opera == 'M':
med = 0
sum = 0
for k in m [l]:
sum = sum + k
med = sum / 12
print (med)
Please wrap code in Python tags to retain the indentation.
So all you need to do is replace your list of lists with a 2D numpy array and use numpy functions to compute sum and med?
sum
is built-in function, don't use it as name.
If we solve it for you using numpy you still will not know numpy - i.e. this is not really helpful.