Challenge: Calculating the Average Mark with *args
Tarea
Swipe to start coding
Let's calculate the average mark for the student. Each student has a different number of marks, so we don't know how many arguments will be passed to the function.
- Set the first positional argument as
namein theaverage_markfunction; - For other arguments use
*args; - In the equation that counts the
markvariable useargswithout*; - In the
printstatement usenameandmarkvariables.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 2. Capítulo 3
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Awesome!
Completion rate improved to 3.7
Challenge: Calculating the Average Mark with *args
Desliza para mostrar el menú
Tarea
Swipe to start coding
Let's calculate the average mark for the student. Each student has a different number of marks, so we don't know how many arguments will be passed to the function.
- Set the first positional argument as
namein theaverage_markfunction; - For other arguments use
*args; - In the equation that counts the
markvariable useargswithout*; - In the
printstatement usenameandmarkvariables.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 2. Capítulo 3
single