QuizSQLite/run.py
def show_all_questions(db: Connection):
    '''print out all the questions nicly- using a type hint to help code completions!!'''
    cursor = db.cursor()
    #get all results
    sql = "SELECT * FROM questions"
    cursor.execute(sql)
    results = cursor.fetchall()
    print("id        Question                                          Answer")
    for result in results:
        print(f"{result['id']:<10}{result['question']:<50}{result['answer']:<50}")
print out all the questions nicly- using a type hint to help code completions!!
print out all the questions nicly- using a type hint to help code completions
print out all the questions nicly - using a type hint to help code completions
def show_all_questions(db: Connection):
    cursor = db.cursor()
    sql = "SELECT * FROM questions"
    cursor.execute(sql)
    results = cursor.fetchall()
    print("id        Question                                          Answer")
    for result in results:
        print(f"{result['id']:<10}{result['question']:<50}{result['answer']:<50}")
def show_all_questions ( db : Connection ) : cursor = db . cursor ( ) sql = "SELECT * FROM questions" cursor . execute ( sql ) results = cursor . fetchall ( ) print ( "id        Question                                          Answer" ) for result in results : print ( f"{result['id']:<10}{result['question']:<50}{result['answer']:<50}" )
print out all the questions nicly- using a type hint to help code completions!
print out all the questions nicly - using a type hint to help code completions!
'''print out all the questions nicly- using a type hint to help code completions!!''' #get all results
db
Connection