name ‘glob’ is not defined

import glob

Here is what the above code is Doing:
1. We’re importing the os module, which contains functions for interacting with the operating system.
2. We’re importing the glob module, which contains functions for finding files based on their names.
3. We’re setting the working directory to the current directory.
4. We’re creating a list of all the files in the current directory that end with .txt.
5. We’re looping through each file in the list.
6. We’re printing the name of the file.
7. We’re opening the file.
8. We’re reading the file.
9. We’re printing the contents of the file.
10. We’re closing the file.