Last active
September 25, 2021 15:39
-
-
Save AbbadonAA/a6a9c8f2a068efc492e9c05a79203b1f to your computer and use it in GitHub Desktop.
Form a list of number's divisors
This file contains 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
def divisors(integer): | |
divs = [] | |
if integer > 1: | |
[divs.append(i) for i in range(2, integer) if integer % i == 0] | |
if not divs: | |
return f'{integer} is prime' | |
else: | |
return divs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment