Advertisement
Fhernd

funciones-argumentos-variable.py

Aug 6th, 2018
10,789
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. def calcular_promedio(valor, *otros):
  2.     return (valor + sum(otros)) / (1 + len(otros))
  3.  
  4.  
  5. print(calcular_promedio(2, 3))
  6. print(calcular_promedio(2, 3, 5, 7))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement