Python Tutorial: How to find all Prime Numbers in a given range [ Prime Numbers in Python]

preview_player
Показать описание
In this video you will learn how to create a simple python program to find all prime numbers between two other number. You can also use the program to determinate if a number is prime number.

Please LIKE and SUBSCRIBE for more content and supporting!
#python #primenumber

Tags:
python prime numbers
Python find all Prime Numbers in a given range
Python how to find prime numbers in a range
Finding prime numbers in python
Рекомендации по теме
Комментарии
Автор

It is a good video, but I don't understand why the math.sqrt is needed. We did it this way:
number = int(input('Type in the number you want ot check: '))
isPrime = True
for i in range(2, number):
if number % i == 0:
isPrime = False
if isPrime:
print(f'{number} is a prime number.')
else:
print(f'{number} is not a prime number.')

memy