# take inputs
      num = int(input('Enter a number: '))
      # If number is greater than 1
      if num > 1:
          for i in range(2, num//2):
              if (num % i) == 0:
                  print(num, "is not a prime number")
                  break
          else:
              print(num, "is a prime number")
      else:
          print(num, "is not a prime number")
      

      Python language logo
      I am Prime

      beginner
      basicMaths
      logic

      Python Program to Check whether the given number is a Prime Number or not

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.