Created
March 10, 2012 10:37
-
-
Save riquellopes/2011091 to your computer and use it in GitHub Desktop.
Apresentar número de uma forma decrescente.
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 | |
""" | |
>>> decrescente(1, 2, 3) | |
3 | |
2 | |
1 | |
>>> decrescente(100, 101, 102) | |
102 | |
101 | |
100 | |
>>> decrescente(1, 9, 3) | |
9 | |
3 | |
1 | |
""" | |
def decrescente(*args): | |
""" | |
Função que ordena número da forma decrescente:: | |
""" | |
numero = sorted(args, reverse=True) | |
print "\n".join(map(str, numero)) | |
if __name__ == '__main__': | |
n1 = input("Digite o 1° numero: ") | |
n2 = input("Digite o 2° numero: ") | |
n3 = input("Digite o 3° numero: ") | |
decrescente(n1, n2, n3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment