
Python Files 4

Quiz
•
Other
•
12th Grade
•
Easy
Amy Austin
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you delete a file in Python?
file.remove('demofile.txt')
delete.file('demofile.txt')
os.remove('demofile.txt')
os.delete('demofile.txt')
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Before deleting a file in Python, what should you check?
If the file is writable
If the file exists
If the file is empty
If the file is closed
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to delete an entire folder in Python?
os.deleteFolder()
os.rmdir()
folder.remove()
os.removeFolder()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is required to manipulate files and directories in Python?
import sys
import directory
import os
import file
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What limitation does the os.rmdir() method have?
It can only remove folders in the current directory
It can only remove empty folders
It can remove any folder regardless of its contents
It can only remove non-empty folders
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which module provides a portable way of using operating system dependent functionality?
pathlib
platform
os
sys
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the os.path.exists() function do?
Checks if a path is an absolute path
Checks if a file or directory exists
Creates a new path
Deletes the specified path
Create a free account and access millions of resources
Similar Resources on Wayground
9 questions
quiz - 7(exceptions and file handling)

Quiz
•
12th Grade - University
8 questions
Basic Microsoft Word Quiz - Part 1

Quiz
•
9th - 12th Grade
10 questions
recuperacao 1 programação desenvolvimento de sistemas

Quiz
•
12th Grade
10 questions
Senangnya membuat ngoding bareng

Quiz
•
9th - 12th Grade
10 questions
Pengetahuan Umum Bahasa Indonesia STAN 2017

Quiz
•
12th Grade
10 questions
Sass and BEM CSS Quiz

Quiz
•
12th Grade
15 questions
Quiz Pretest

Quiz
•
12th Grade
10 questions
ANALISIS DATA

Quiz
•
7th Grade - University
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade