try python import 1

try python import

try:
  import os                     
except:
  print('Can not import')

Here is what the above code is Doing:
1. Importing the os module
2. Creating a variable called ‘path’ and setting it to the current working directory
3. Creating a variable called ‘files’ and setting it to a list of all the files in the current working directory
4. Creating a variable called ‘file_count’ and setting it to the length of the list of files in the current working directory
5. Printing the number of files in the current working directory

Similar Posts