MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / Update

Function Update

projects/inventory management/main.py:55–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53
54
55def Update():
56 code = int(input("Enter the product id to update:"))
57 pid = int(input("Enter product id:"))
58 pname = input("Enter product name:")
59 pcost = int(input("Enter the product cost:"))
60 pqty = int(input("Enter the product quantity:"))
61 query = (
62 "update inventory set PID={},PNAME='{}',PCOST={},PQTY={} where PID={}".format(
63 pid, pname, pcost, pqty, code
64 )
65 )
66 cursor.execute(query)
67 con.commit()
68 print("Data Updated SuccessfullY")
69
70
71# Deleting records

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected