Python question

Asked 2 years ago, Updated 2 years ago, 67 views

Hello, everyone

I got a syntax error while coding Python, but I don't understand why In the first coding, there was an error in the sum_even(result) function. Is it because you use a,b without knowing exactly what the result is? If you do so, why does that error appear in the second corrected coding? (Error same as the previous error)

python coding

2022-09-22 19:38

1 Answers

If len(result) is 10, the possible indexes are 0 to 9.

At this time a=10

b= (10-1)/3 +1 =4

I'm going to loop around 0, 1, 2, 3...

i = 3 if

result[3*3+1] = result[10] beyond the possible index...


2022-09-22 19:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.