Skip to content

Instantly share code, notes, and snippets.

@riquellopes
Created March 10, 2012 10:37
Show Gist options
  • Save riquellopes/2011091 to your computer and use it in GitHub Desktop.
Save riquellopes/2011091 to your computer and use it in GitHub Desktop.
Apresentar número de uma forma decrescente.
# 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