This code is taking forever to execute and showing run-error

I have checked this code in other IDEs and it seems to be working fine with all inputs.
https://ide.codingblocks.com/s/67681

Hey Vaibhav, your code is working fine its just that you haven’t printed the output, so update
line:12 as print(isPrime(x))

one more thing is there is no need of writing a break statement just after the return statement, because that break statement will never be executed as program will get returned from return statement and control will never reach to that break statement. So, you can remove that break statement from line:7.

It still shows wrong-answer for all the test cases.

Hi Vaibhav, Your output should exactly match with the problem’s output format. Here the wrong answer is because of your code’s line:1 x = int(input("enter a number")) you are not supposed to print “enter a number” on console, just take the input as x = int(input())

Hey Vaibhav,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.