from my_functions import open_csvtest_db
from my_functions import close_database

conn, cursor = open_csvtest_db()
sql = '''
SELECT AVG(Age) FROM titanic WHERE Age <>""
'''
cursor.execute(sql)
avg = cursor.fetchone()
print(avg[0])
close_database(cursor, conn)