import sqlite3 print("Welcome to B&J!") print("What's your fave flave?") conn = sqlite3.connect("/home/stephen/teaching/350/bj.db") cursor = conn.execute("select name from flavor") results = cursor.fetchall() for i in range(len(results)): print(f"{i+1}) {results[i][0]}") choice = int(input("> ")) faveFlave = results[choice-1][0] print(f"Which of our award-winning {faveFlave}-based recipes do u want?") cursor = conn.execute("select name from recipe where flavorName=?", (faveFlave,)) results = cursor.fetchall() for i in range(len(results)): print(f"{i+1}) {results[i][0]}") choice = int(input("> ")) chosenRecipe = results[choice-1][0] newChoice = int(input(f"How many cartons of {chosenRecipe} do you want? ")) conn.execute("update recipe set cartonsOrdered=cartonsOrdered+? where name=?", (newChoice, chosenRecipe)) conn.commit() conn.close()