
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
10 questions
Python - String Concatenation - 4

Quiz
•
12th Grade
15 questions
DBZBS-Dikkat ve Bilgisayar Zekası Beceri Sınavı

Quiz
•
4th Grade - University
10 questions
Quiz sobre mBlock e Arduino

Quiz
•
12th Grade
9 questions
Desporto

Quiz
•
1st Grade - University
11 questions
quiz - 8 - day - 4

Quiz
•
12th Grade - University
15 questions
Online Class-2 ( Chp 4 - Qz 2)

Quiz
•
12th Grade
9 questions
quiz - 7(exceptions and file handling)

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

Quiz
•
12th Grade
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
11 questions
NFL Football logos

Quiz
•
KG - Professional Dev...
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
29 questions
CCG 2.2.3 Area

Quiz
•
9th - 12th Grade
15 questions
PRESENTE CONTINUO

Quiz
•
9th - 12th Grade
13 questions
BizInnovator Startup - Experience and Overview

Quiz
•
9th - 12th Grade
16 questions
AP Biology: Unit 1 Review (CED)

Quiz
•
9th - 12th Grade