()
| 13 | |
| 14 | |
| 15 | def update(): |
| 16 | with open(student_record, "rb") as File: |
| 17 | value = pickle.load(File) |
| 18 | found = False |
| 19 | roll = int(input("Enter the roll number of the record")) |
| 20 | |
| 21 | for i in value: |
| 22 | if roll == i[0]: |
| 23 | print(f"current name {i[1]}") |
| 24 | print(f"current marks {i[2]}") |
| 25 | i[1] = input("Enter the new name") |
| 26 | i[2] = int(input("Enter the new marks")) |
| 27 | found = True |
| 28 | |
| 29 | if not found: |
| 30 | print("Record not found") |
| 31 | |
| 32 | with open(student_record, "wb") as File: |
| 33 | pickle.dump(value, File) |
| 34 | |
| 35 | |
| 36 | update() |
no test coverage detected