Course Content
Intermediate Python: Arguments, Scopes and Decorators
Intermediate Python: Arguments, Scopes and Decorators
Challenge: Average Mark
Task
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.
Thanks for your feedback!
Challenge: Average Mark
Task
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.
Thanks for your feedback!
Challenge: Average Mark
Task
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.
Thanks for your feedback!
Task
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.