Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Head count and Attendance marking system #3510

Closed
wants to merge 1 commit into from

Conversation

saimanohar22
Copy link

with the help of this code we can easily be able to get the head count and attendance marking system in python file

class AttendanceSystem:
def init(self):
self.attendance_record = {}

def mark_attendance(self, name):
    if name in self.attendance_record:
        print(f"{name} is already marked present.")
    else:
        self.attendance_record[name] = True
        print(f"{name} is marked present.")

def get_head_count(self):
    return len(self.attendance_record)

def get_attendance_list(self):
    return list(self.attendance_record.keys())

def main():
attendance_system = AttendanceSystem()

while True:
    print("\n1. Mark Attendance\n2. View Head Count\n3. View Attendance List\n4. Exit")
    choice = input("Enter your choice: ")

    if choice == '1':
        name = input("Enter the name of the person: ")
        attendance_system.mark_attendance(name)
    elif choice == '2':
        print(f"Head count: {attendance_system.get_head_count()}")
    elif choice == '3':
        print("Attendance List:")
        attendance_list = attendance_system.get_attendance_list()
        for name in attendance_list:
            print(name)
    elif choice == '4':
        print("Exiting...")
        break
    else:
        print("Invalid choice. Please try again.")

if name == "main":
main()

with the help of this code we can easily be able to get the head count and attendance marking system in python file
@alex-jansen
Copy link
Contributor

This looks like some sample / experimental python code that does not belong here. Closing this request but feel free to reopen if we need to discuss this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants