Contenido del Curso
Intermediate Python Techniques
Intermediate Python Techniques
Challenge: Average Mark
Swipe to show code editor
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
name
in theaverage_mark
function; - For other arguments use
*args
; - In the equation that counts the
mark
variable useargs
without*
; - In the
print
statement usename
andmark
variables.
¡Gracias por tus comentarios!
Challenge: Average Mark
Swipe to show code editor
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
name
in theaverage_mark
function; - For other arguments use
*args
; - In the equation that counts the
mark
variable useargs
without*
; - In the
print
statement usename
andmark
variables.
¡Gracias por tus comentarios!
Challenge: Average Mark
Swipe to show code editor
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
name
in theaverage_mark
function; - For other arguments use
*args
; - In the equation that counts the
mark
variable useargs
without*
; - In the
print
statement usename
andmark
variables.
¡Gracias por tus comentarios!
Swipe to show code editor
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
name
in theaverage_mark
function; - For other arguments use
*args
; - In the equation that counts the
mark
variable useargs
without*
; - In the
print
statement usename
andmark
variables.