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
from time import time | |
def isPrime(numberToCheck)->bool: | |
"""Checks if a number is prime by trying to divide it cleanly by all numbers from to to itself -1""" | |
if numberToCheck <= 1: | |
return False | |
if type(numberToCheck) == float: | |
return False | |
def primesUpTo(upperLimit, lowerLimit=0): |
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
from time import sleep, time | |
def isPrime(numberToCheck)->bool: | |
"""Checks if a number is prime by trying to divide it cleanly by all numbers from to to itself -1""" | |
if numberToCheck <= 1: | |
return False | |
if type(numberToCheck) == float: | |
return False | |
# noinspection PyArgumentList |