D
D
Dmitry Gornostaev2020-05-19 09:21:24
Python
Dmitry Gornostaev, 2020-05-19 09:21:24

I enter the code into Python, an error comes out, I can’t understand what’s the matter, what should I do?

a=[2,4,3,1,7,5,-6]
for I in range (i,len((a)-i)
  if a(i-1)<a(i) and a(i)>a(i+1)
print(i, end=” “)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Timur Pokrovsky, 2020-05-19
@Makaroshka007

if a(i-1)<a(i) and a(i)>a(i+1):
: at the end put

H
Hcuy, 2020-05-19
@Hcuy

Maybe I'm wildly dumb, but isn't there after for should there be i instead of I? If not, please correct me. for I in range (i,len((a)-i)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question