Please this error keep returning. I need guidance on how to overcome this error

File “”, line 28
for i in the range(m) :
SyntaxError: invalid syntax


Syntax errors are usually reported on the line after where the problem is.
So look at the previous line (prior to the for-statement).

Most often this is due to these sorts of issues:

  • spelling errors
  • incorrect indentation
  • mis-placed parenthesis

As mentioned by the other mentor, syntax error when can occur

change/correct the for statement by comparing your code lines with the below given code line.


for i in range(m):

P.S. these assignments are sensitive to the template code, making any change to the grader cells other than replacing None with your written code can cause failure in passing the grader.

Happy learning!!!


1 Like

My friend,
Please compare the above code with the following.

for i in range(m):

Note: Please remove ‘the’ in your code.

He has already finished his assignment. The conversation was transferred to personal DM.

@George_Adedoyin_Olaw Probably it is better you select the comment which addressed your issue, so this thread is closed and no further comments or confusion is created.

Thank you



@Parbat_Budha, thanks for noticing that, I overlooked it.

Closing the thread.