Check wheather a number is composite or not

#Credits to NPTEL MOOC, Programming, Data Structures & Algorithms in 
#Python by Madhavan Mukund, Chennai Mathematical Institute 
 
def composite(n):
      for i in range(2,n):
        if n%i == 0:
          return(True)
      return(False)

No comments: