PYTHON Study Guide - Prime Number, Largest Known Prime Number

8 views3 pages
26 May 2023
Department
Course
Professor

Document Summary

#25 python tutorial for beginners | prime numbers in python. Section overview: in this section, the speaker introduces prime numbers and explains what they are. A prime number is a number that is only divisible by one and itself. Examples of prime numbers include 7 and 19. Non-prime numbers have factors other than one and themselves. Section overview: in this section, the speaker explains how to check if a given number is prime or not. ## steps to check if a number is prime. Start by dividing the number by 2. If it"s divisible by 2, it"s not a prime number. If it"s not divisible by 2, move on to divide it by 3, then 4, then 5, etc. , until you reach one less than the number itself. If at any point during this process the number is found to be divisible without leaving a remainder, it"s not a prime number.