11 lines
389 B
Python
11 lines
389 B
Python
from cs50 import sql
|
|
|
|
db = sql.SQL("sqlite:///gremlin.db")
|
|
partnumber = input("Partnumber?: ")
|
|
count = db.execute("SELECT COUNT(*) FROM pricelist WHERE Partnumber = ?;", partnumber)
|
|
rows = db.execute("SELECT * FROM pricelist WHERE Partnumber = ?;", partnumber)
|
|
|
|
for row in rows:
|
|
print(f"{row['Partnumber']} | {row['Option']} | {row['Description']}")
|
|
|
|
print(f"Found {count} products.") |