Python-check prime

sir what is the mistake in my code

@qudsiya scope of i does not exist outside of the for loop. So you cannot use it to check if i==n after the loop ends.