×We're offering Women's Scholarships for applicants to our February class! Details here.
For the first part of this exercise assume you have a file called
students.txt which simply contains a bunch of student names, one name per line. Your goal is to write two functions:
add_student- accepts a parameter of
first_nameand writes to a file called
find_student- accepts a parameter of
first_nameand returns the first student found
update_student- accepts a parameter of
new_nameand updates first student found
remove_student- accepts a parameter of
first_nameand removes the student from the text file
For the next part of this exercise, you will be working with CSVs, so first create a file called
users.csv and then work on the following two functions:
For solutions to these exercises, click here.
When you're ready, move on to Generators and Iterators