Question: For this lab, you will write a Python program that will create and edit a text file called users.txt . The file should be created
For this lab, you will write a Python program that will create and edit a text file called
users.txt The file should be created in the same folder as your python file and will
contain a list of usernames, with one name per line.
Your program should only define and implement the following functions:
createfileAccepts no arguments and creates the empty file called
users.txt
adduser Accepts a username as an argument and appends it to the file
updateuser Accepts an old username and a new username as separate
arguments and replaces any instance of that the old username with the new
username in the file.
removeuser Accepts a username as an argument and removes the user
from the file
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
