Challenge: Calculating the Average Mark with *args
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 2. Capitolo 3
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Awesome!
Completion rate improved to 3.7
Challenge: Calculating the Average Mark with *args
Scorri per mostrare il menu
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 2. Capitolo 3
single