Challenge: Calculate Class Attendance
Keeping track of attendance is a common classroom task. In this challenge, you'll use a list of attendance counts to calculate the total and average attendance.
Swipe to start coding
Write a Python script that takes a list of attendance numbers for each student, calculates the total and average attendance, and prints the results.
- Calculate the sum of all values in
attendance_list. - Calculate the average attendance by dividing the total by the number of students in
attendance_list. - Print the total attendance.
- Print the average attendance.
Løsning
Takk for tilbakemeldingene dine!
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
How do I calculate the total attendance from a list?
How do I find the average attendance using the attendance counts?
Can you show me an example list of attendance counts?
Fantastisk!
Completion rate forbedret til 4.76
Challenge: Calculate Class Attendance
Sveip for å vise menyen
Keeping track of attendance is a common classroom task. In this challenge, you'll use a list of attendance counts to calculate the total and average attendance.
Swipe to start coding
Write a Python script that takes a list of attendance numbers for each student, calculates the total and average attendance, and prints the results.
- Calculate the sum of all values in
attendance_list. - Calculate the average attendance by dividing the total by the number of students in
attendance_list. - Print the total attendance.
- Print the average attendance.
Løsning
Takk for tilbakemeldingene dine!
single