0
Find the error and give the correct program.This program is to print the sum of series 1/1+22/2...+nn/n
4 Answers
0
Mainly syntax errors, in for loop keyword "in" was omitted.
and
2 lines after that lacked an indent level, that was supposed to be given for code that belongs to the for loop.
0
Now it is an indent error, lines after the line 3 are supposed to have an indent level, a space or tab.
0
#Code after:
for i in range(1, n+1):
#is supposed to get indented.
Line4
Line5
0
#This is invalid:
for i in range(1, n+1):
Line4
Line5
#Because program does not know which code would belong for the for loop statement.