Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 


Write a program in Python to check if a number is prime?
Question Posted on 11 May 2022

Home >> Python Programming >> Python Questions >> Write a program in Python to check if a number is prime?




Write a program in Python to check if a number is prime?
Below is the code to write a number is prime or not and code is given below:-

y=int(input("Enter Any Number"))
if y=1:
   for x in range(2,y):
     if(y%x)==0:
      print("Number is not prime")
   break
   else:
    print("Number is Prime")
else:
   print("Number is not prime")
0
0



 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


Other Important Questions
Program to check sequence is palindrome or not?
Can you define Memory Management in Python?
Can you define dictionary in Python?
Can you please mention some builtin Data Types in Python?
Write a code to read JSON file and print data of JSON in Python?






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |