def ls(dir): import os return(os.listdir(dir))
import osprint(os.listdir('directorypath'))# Replace 'directorypath' with path to directory- def ls(dir):
- import os
- return(os.listdir(dir))
# TODO: Replace examples and use TDD development by writing your own tests # These are some of the methods available: # test.expect(boolean, [optional] message) # test.assert_equals(actual, expected, [optional] message) # test.assert_not_equals(actual, expected, [optional] message) test.assert_equals(ls("/home"), ['codewarrior']) # You can use Test.describe and Test.it to write BDD style test groupings
- # TODO: Replace examples and use TDD development by writing your own tests
- # These are some of the methods available:
- # test.expect(boolean, [optional] message)
- # test.assert_equals(actual, expected, [optional] message)
- # test.assert_not_equals(actual, expected, [optional] message)
- test.assert_equals(ls("/home"), ['codewarrior'])
- # You can use Test.describe and Test.it to write BDD style test groupings