-
-
Save fernandezpablo85/a9a40cd3852fc39524f84702733fa133 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 obtener_2_mayores(*numeros): | |
max1=max(numeros) | |
max2=min(numeros) | |
for i in range(len(numeros)): | |
if numeros[i]<max1>max2: | |
max2=numeros[i] | |
return max1,max2 | |
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