Conteúdo do 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.
Obrigado pelo seu feedback!
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.
Obrigado pelo seu feedback!