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

Function Search

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

Source from the content-addressed store, hash-verified

36
37
38def Search():
39 val = int(input("Enter the product code to search:"))
40 flag = 0
41 cursor.execute("select * from inventory")
42 record = cursor.fetchall()
43 for i in record:
44 if i[0] == val:
45 flag = 1
46 print("ID", " ", "Name", " ", "Cost", "", "Quantity")
47 print(i)
48 if flag == 0:
49 print("---Record not found---")
50
51
52# Updating existing record on the basis of product ID

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected