0

Find the error and give the correct program.This program is to print the sum of series 1/1+22/2...+nn/n

https://code.sololearn.com/cA3UpqVpr1ho/?ref=app

3rd Oct 2019, 5:08 PM
Monish
4 Respuestas
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.
3rd Oct 2019, 5:15 PM
Seb TheS
Seb TheS - avatar
0
Now it is an indent error, lines after the line 3 are supposed to have an indent level, a space or tab.
3rd Oct 2019, 5:22 PM
Seb TheS
Seb TheS - avatar
0
#Code after: for i in range(1, n+1): #is supposed to get indented. Line4 Line5
3rd Oct 2019, 5:24 PM
Seb TheS
Seb TheS - avatar
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.
3rd Oct 2019, 5:25 PM
Seb TheS
Seb TheS - avatar