Write data to a CSV file
Create a table whose headers are "Name", "Age", and "Email Address". Then add your name, age, and email address as the first data row.
Write the table to a file called user_data.csv. Use a nested list to represent the rows, pathlib.Path for the file path, and the csv module to write the data. Opening a file in write mode replaces its existing contents, so test your function with a disposable file.
Start from the function template in Listing 1.