- Contstruct the path to the text file in the data directory using the
pathlib
module
- Read the text file
- Count the occurences of each item in the text file
Count items with imported function. To see what the function looks like click the + sign.
- Using
pathlib
check if a directory with namesolution
exists and if not create it
Construct path to output file
- Write the counts to the file
counts.csv
in thesolution
directory in the format (first line is the header)
item, count
item_name_1, item_count_1
item_name_2, item_count_2
…