Q. Which function lists all files in a directory?

  • (A) os.listdir()
  • (B) os.showfiles()
  • (C) list.files()
  • (D) os.scan()
πŸ’¬ Discuss
βœ… Correct Answer: (A) os.listdir()
Explanation: os.listdir() returns a list of all files and folders in the specified directory.
Explanation by: Mr. Dubey
os.listdir() returns a list of all files and folders in the specified directory.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
71
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
89%
Success Rate