Last active
September 10, 2018 00:44
-
-
Save MasterTuto/44211b2127085a75dd2e6e934856c039 to your computer and use it in GitHub Desktop.
Fatoração de Números
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
#-*- coding: utf-8 -*- | |
def fatorar(num): | |
used_numbers = [] | |
for number in range(2, num): | |
while num % number == 0: | |
num = num / number | |
used_numbers.append(number) | |
return used_numbers if len(used_numbers) > 0 else "Esse número não pôde ser fatorado." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment