Skip to content

Instantly share code, notes, and snippets.

@tvillanueva
Last active September 12, 2019 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tvillanueva/d2bc01d4dcafe988faaec100f081c4f1 to your computer and use it in GitHub Desktop.
Save tvillanueva/d2bc01d4dcafe988faaec100f081c4f1 to your computer and use it in GitHub Desktop.
def obtener_2_mayores(*numeros):
return obtener_n_mayores(2,numeros)
def obtener_mayor_par(*numeros):
maxp=[]
for i in range(len(numeros)):
if numeros[i]%2==0:
maxp.append(numeros[i])
if len(maxp)>1:
return max(maxp)
else:
maxp=None
return maxp
def obtener_n_mayores(n,*numeros):
numbers=list(numeros)
numbers.sort(reverse=True)
mayores=list(numbers[:n])
return mayores
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment