Computer Science, asked by Anonymous, 10 months ago

PYTHON CHALLENGE

MAKE A PROGRAM TO CHECK WETHER A NUMBER IS PRIME OR NOT..

DON'T COPY FROM GOOGLE

DO IT YOURSELF

I WILL CHECK WETHER THE QUESTION IS COPIED OR DONE BY U


:):):):)


Anonymous: GO AND CRACK IT
Anonymous: ALSO PUT IMAGE OF YOUR CODE WITH OUTPUT
Anonymous: IN PYTHON INTERPRETER
Anonymous: hey buddy I did this in Jupyter
Anonymous: U HAVE COPIED IT
Anonymous: you know python ?
Anonymous: YES
Anonymous: U KNOW PYTHON
Anonymous: yep (not completely

Answers

Answered by Anonymous
1

Answer:

# FUNCTION TO CHECK WHETHER THE GIVEN NUMBER IS PRIME OR NOT

def prime(n):

   for i in range(2,n):

       if n%i==0:

           print("not a prime")

           break

       else:

           print("prime")

           break

#MAIN

a=int(input("enter the number"))

prime(a)

                                                            (or)

#program to find whether the number is prime or not

n=int(input("enter the number"))

i=2

while i<=n-1:

   if n%i==0:

       print("composite")

       break

   i+=1

else:

   print("prime")

#here is your answer

please mark brainliest


Anonymous: why???
Anonymous: WHO DEVELOPED PYTHON
Anonymous: guido van Rossum
Anonymous: WHAT IS TENSERFLOW IN PYTHON
Anonymous: its a library which helps in fast mathematical calculations
Anonymous: NO,IT IS A LIBRARY FOR MACHINE LEARNING
Anonymous: its in python too r
Anonymous: CONGRATS NEXT PYTHON QUESTION WILL BE TOMMOROW
Anonymous: hmm..thank you
Anonymous: WELCOME
Similar questions