This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Correcting exclusion of last factor that needs to be checked | |
# Micro optimization of code | |
# Code syntax/format preference changes | |
# Might as well be able to check any number | |
# The algorithm builds a list of factors including the number 2 and all odd numbers | |
# up to the square root of "a", and then checks if any of those numbers divides "a" | |
# without a remainder - if so then "a" is not prime, else it is | |
from math import sqrt |