Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started