MCPcopy Create free account
hub / github.com/geekcomputers/Python / update

Function update

file_handle/File handle binary/update2.py:10–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

update2.pyFile · 0.70

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected