Question: Which statement about the following Python code is correct? import os folder = input ( Enter a folder name: ) all _ files

Which statement about the following Python code is correct?
import os
folder = input("Enter a folder name: ")
all_files = os.listdir(folder)
for file in all_files:
file_path = os.path.join(folder, file)
if os.path.isdir(file_path):
print(file_path)
It will raise an exception if the folder input by the user is empty.
It will display True for each item in the folder input by the user that is a directory and False for each item that is not.
It will display the names of any subfolders found within the folder input by the user.
It will display the names of any files found within the folder input by the user.
 Which statement about the following Python code is correct? import os

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!