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 inputEnter a folder name:
allfiles oslistdirfolder
for file in allfiles:
filepath ospath.joinfolder file
if ospath.isdirfilepath:
printfilepath
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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
