()
| 10 | |
| 11 | |
| 12 | def update(): |
| 13 | with open(student_record, "rb") as F: |
| 14 | S = pickle.load(F) |
| 15 | found = False |
| 16 | rno = int(input("enter the roll number you want to update")) |
| 17 | |
| 18 | for i in S: |
| 19 | if rno == i[0]: |
| 20 | print(f"the current name is {i[1]}") |
| 21 | i[1] = input("enter the new name") |
| 22 | found = True |
| 23 | break |
| 24 | |
| 25 | if found: |
| 26 | print("Record not found") |
| 27 | |
| 28 | with open(student_record, "wb") as F: |
| 29 | pickle.dump(S, F) |
| 30 | |
| 31 | |
| 32 | update() |