The following task is designed to introduce you to databases using sqlite3. In practice, what you will be implementing can be done in other ways and without databases but we'll use a database for learning purposes.
You'll be creating a table to store all guesses that a user makes.
Using sqlite modify your code so that:
A database table is created immediately the program starts up
The name of the table should be 'Guesses'
The table should consist of one column named 'letter'
The column should only accept a single character
The table is dropped (deleted) when the game ends
Note:
The database code should be in a new module at lib/database.py. However you can call functions declared there from other modules in your code.
the actual database file should be in the data/ directory.
The following task is designed to introduce you to databases using sqlite3. In practice, what you will be implementing can be done in other ways and without databases but we'll use a database for learning purposes.
You'll be creating a table to store all guesses that a user makes.
Using sqlite modify your code so that:
Note:
lib/database.py
. However you can call functions declared there from other modules in your code.data/
directory.