os module print content of directory code example Example: python program to print the contents of a directory using os module import os li = os.listdir(".") print(li)