Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions