Python Input and Output
Python Input and Output - Important Points
16. | Which function is used to remove a file in Python? |
---|
A. os.remove()
B. os.rename()
C. os.mkdir()
D. D. os.rmdir()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The os.remove() function is used to remove a file in Python.
17. | Which function is used to rename a file in Python? |
---|
A. os.rename()
B. os.remove()
C. os.mkdir()
D. D. os.rmdir()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The os.rename() function is used to rename a file in Python.
18. | Which function is used to remove a directory in Python? |
---|
A. os.rmdir()
B. os.remove()
C. os.rename()
D. D. os.mkdir()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The os.rmdir() function is used to remove a directory in Python.
19. | Which module is used to work with CSV files in Python? |
---|
A. csv
B. os
C. sys
D. D. io
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The csv module is used to work with CSV files in Python.
20. | Which function is used to open a CSV file in Python? |
---|
A. csv.reader()
B. csv.writer()
C. csv.open()
D. D. csv.read()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The csv.reader() function is used to open a CSV file in Python.