Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I am having the problem.why is below code else part going to wrong

Python
n =int(raw_input())
i=2
while(i<n):>
   if n%i==0:
     print "not Prime"
     break;
   i+=1
   elese:
     print "prime"
Posted
Updated 25-Aug-14 21:09pm
v2
Comments
Sergey Alexandrovich Kryukov 26-Aug-14 3:07am    
Python is sensitive to format, which you lost.
I fixed it for you. Please click "Improve Question", just to see how it should be done, use in future.

What is your problem? Of course, if you are going to type "elese" and the like, you won't go far.

—SA
nuke_infer 26-Aug-14 3:21am    
Dear Sa else part i typed correctly in programming.but can you tell me why it happening i mean else part not execute

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900