Question: ' ' ' Name : your full name File : registration.py ' ' ' # a function to open a file, registration,txt , name the
Name : your full name
File : registration.py
# a function to open a file, registration,txt name the file object to "fileregistration", and display the list of the courses
# this function is only to display the file to the console
def readenrollment:
Before we read the contents of the file, we tell Python which file we're going to work with by using the open function.
Remember, after we open a file, explicitly close it when we are done with it by using close
OR we will use more convenient way by using "with". Using the with statement is more safer way to handle file IO
as it automatically takes care of closing the file.
with openregistrationtxtr as fileregistration:
# TODO : display the data from registration.txt fileie list of the courses in the console
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
