Question: Python code 2. Define a function list_directory that takes in a directory name (as a string) as the argument. Your function will change directories to

 Python code 2. Define a function list_directory that takes in a

Python code

2. Define a function list_directory that takes in a directory name (as a string) as the argument. Your function will change directories to the directory name given and return a list of its contents. You may assume that the directory exists and is ocatedinaidethe tolder trom which you sre curenty working How to test: # call inside main() function print Testing list_directoryl'csc111) print 'Expected:['lab1', 'lab2', "lab3', 'lab4, "lab5', "lab6', "lab7, print Actual:', list_directory csc111)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!