File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
1 File handle/File handle binary Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
import pickle
2
-
2
+ from typing import List , Tuple
3
3
4
4
def delete_student_record () -> None :
5
5
"""
@@ -21,14 +21,14 @@ def delete_student_record() -> None:
21
21
try :
22
22
# Read existing student records from file
23
23
with open ("studrec.dat" , "rb" ) as file :
24
- student_records : list [ tuple [int , ...]] = pickle .load (file )
24
+ student_records : List [ Tuple [int , ...]] = pickle .load (file )
25
25
print ("Current student records:" , student_records )
26
26
27
27
# Get roll number to delete
28
28
roll_number : int = int (input ("Enter the roll number to delete: " ))
29
29
30
30
# Filter out the record with the specified roll number
31
- updated_records : list [ tuple [int , ...]] = [
31
+ updated_records : List [ Tuple [int , ...]] = [
32
32
record for record in student_records if record [0 ] != roll_number
33
33
]
34
34
You can’t perform that action at this time.
0 commit comments