Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started