Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Calculate Class Attendance | Getting Started with Python for the Classroom
Python for Teachers

bookChallenge: 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.

Taak

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.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 7
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Suggested prompts:

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?

close

bookChallenge: Calculate Class Attendance

Veeg om het menu te tonen

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.

Taak

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.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 7
single

single

some-alt