list directory in python

import os 
my_list = os.listdir('My_directory')

Here is what the above code is Doing:
1. We’re importing the os module.
2. We’re creating a variable called my_list.
3. We’re setting my_list equal to the result of calling the listdir function from the os module.
4. We’re printing my_list.