"Like , Share and Subscribe " #PrimeNumber
---------------------------------------------------------------------------------------------------------------------
Python is a simple, general purpose, high level, and object-oriented programming language.
Python is an interpreted scripting language also. Guido Van Rossum is known as the founder of Python programming.
-----------------------------------------------------------------------------------------------------------------
Python Program to Check Prime Number:
code:
A default function for Prime checking conditions
def PrimeChecker(a):
Checking that given number is more than 1
if a - 1: #note : replace ( - ) by angle brackets
Iterating over the given number with for loop
for j in range(2, int(a/2) + 1):
If the given number is divisible or not
if (a % j) == 0:
print(a, "is not a prime number")
break
Else it is a prime number
else:
print(a, "is a prime number")
If the given number is 1
else:
print(a, "is not a prime number")
Taking an input number from the user
a = int(input("Enter an input number:"))
Printing result
PrimeChecker(a)
---------------------------------------------------------------------------------------------------------------------
#pythonprogram
#learnpython
#quadratic_equation
#Generate_a_Random_Number
#python_equation
#RandomNumber
---------------------------------------------------------------------------------------------------------------------
Смотрите видео Python Program to Check Prime Number онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь CodeLSC 26 Октябрь 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7 раз и оно понравилось 0 людям.