Created
August 6, 2018 23:14
-
-
Save Fhernd/26982882b9a777a7b322054a7a835f94 to your computer and use it in GitHub Desktop.
Funciones con argumentos variable. OrtizOL.
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
def calcular_promedio(valor, *otros): | |
return (valor + sum(otros)) / (1 + len(otros)) | |
print(calcular_promedio(2, 3)) | |
print(calcular_promedio(2, 3, 5, 7)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment