Skip to content

Commit 097e6f6

Browse files
committed
fix
1 parent 5bf8a1f commit 097e6f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

1 File handle/File handle binary/Deleting record in a binary file.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pickle
2-
2+
from typing import List, Tuple
33

44
def delete_student_record() -> None:
55
"""
@@ -21,14 +21,14 @@ def delete_student_record() -> None:
2121
try:
2222
# Read existing student records from file
2323
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)
2525
print("Current student records:", student_records)
2626

2727
# Get roll number to delete
2828
roll_number: int = int(input("Enter the roll number to delete: "))
2929

3030
# Filter out the record with the specified roll number
31-
updated_records: list[tuple[int, ...]] = [
31+
updated_records: List[Tuple[int, ...]] = [
3232
record for record in student_records if record[0] != roll_number
3333
]
3434

0 commit comments

Comments
 (0)