How to build a student’s attendance app using python

Here is a simple way to build a student attendance application with Python:

  1. Create a list of students:

students = [
{“name”: “John Doe”, “attendance”: 0},
{“name”: “Jane Doe”, “attendance”: 0},
{“name”: “Bob Smith”, “attendance”: 0}
]

  1. Create a function to mark a student present:

def mark_present(student):
student[“attendance”] += 1

  1. Create a function to display the attendance for all students:

def display_attendance(students):
for student in students:
print(f”{student[‘name’]}: {student[‘attendance’]}”)

  1. Create a main function to run the attendance application:

def main():
while True:
name = input(“Enter the name of the student: “)
for student in students:
if student[“name”] == name:
mark_present(student)
break
display_attendance(students)

if __name__ == “__main__”:
main()

 

This is a simple example of a student attendance application with Python.

You can expand on this by adding features such as saving and loading the attendance data from a file, keeping track of attendance over multiple days, and adding a graphical user interface.

About Author


Discover more from SURFCLOUD TECHNOLOGY

Subscribe to get the latest posts sent to your email.

Leave a Reply

Your email address will not be published. Required fields are marked *

Discover more from SURFCLOUD TECHNOLOGY

Subscribe now to keep reading and get access to the full archive.

Continue reading