-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAttendence_Management.py
45 lines (40 loc) · 1.41 KB
/
Attendence_Management.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# import os
# Dictionary to store attendance records
attendance_records = {}
def mark_attendance():
date = input("Enter the date (YYYY-MM-DD): ")
while True:
roll_number = input("Enter Roll Number (or 'q' to exit): ")
if roll_number == 'q':
break
if roll_number not in attendance_records:
attendance_records[roll_number] = {}
if date not in attendance_records[roll_number]:
attendance_records[roll_number][date] = 'Present'
else:
print("Attendance already marked for this date.")
def view_attendance():
roll_number = input("Enter Roll Number to view attendance: ")
if roll_number in attendance_records:
print(f"Attendance for {roll_number}:")
for date, status in attendance_records[roll_number].items():
print(f"{date}: {status}")
else:
print("No attendance records found for this Roll Number.")
def main_menu():
while True:
print("\nAttendance Management System")
print("1. Mark Attendance")
print("2. View Attendance")
print("3. Exit")
choice = input("Enter your choice: ")
if choice == '1':
mark_attendance()
elif choice == '2':
view_attendance()
elif choice == '3':
break
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main_menu()