0
Hi. Could you please tell me what is wrong with this code?(expected an indented block(line4))
n, p = [int(x) for x in input().split()] lista = [] for i in range(n): lista.append(input().split()) print(np.array(lista).astype(np.float16).mean(axis=1).round(2))
5 odpowiedzi
+ 5
You need to care about indentation when you're using loops or decision statements(if-else)
n,p= [int(x) for x in input().split()]
lista = []
for i in range(n):
lista.append(input().split())
print(np.array(lista).astype(np.float16).mean(axis=1).round(2))
+ 2
Maybe you missed to import numpy module.
import numpy as np
+ 1
Thank you very much
0
In my opinion, a completely understandable warning: "Indented block is expected (line 4)" 🤔
Don't you know what "indentation" is?
You've even been told the line 4 you should to indent.
0
Thanks Simba. But it says that np is undefined(line5)