Quiz 6

Quiz 6

Professional Development

25 Qs

quiz-placeholder

Similar activities

City & Guilds Level 3 Apprenticeship Coding and Logic

City & Guilds Level 3 Apprenticeship Coding and Logic

Professional Development

20 Qs

CĐ Y DƯỢC SÀI GÒN GV TRẦN THỊ NGỌC CHÂU

CĐ Y DƯỢC SÀI GÒN GV TRẦN THỊ NGỌC CHÂU

Professional Development

23 Qs

CMT File Sizes and Information Review

CMT File Sizes and Information Review

11th Grade - Professional Development

22 Qs

Basic Computer Skills Pipe Trades Apprentice

Basic Computer Skills Pipe Trades Apprentice

Professional Development

20 Qs

Pre Tes Bimtek Bantuan DAK Tahun 2022

Pre Tes Bimtek Bantuan DAK Tahun 2022

Professional Development

20 Qs

Microsoft Excel Basics

Microsoft Excel Basics

Professional Development

20 Qs

Linux Editing Files

Linux Editing Files

Professional Development

27 Qs

Girty Docker

Girty Docker

University - Professional Development

20 Qs

Quiz 6

Quiz 6

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Moirangthem Sonia

Used 1+ times

FREE Resource

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

5 mins • 10 pts

Which of the following best describes a text file?

Stores human-readable characters using encodings like ASCII or UTF-8

Stores only images and videos

 Contains only binary machine instructions

Cannot be edited with text editors

2.

MULTIPLE CHOICE QUESTION

5 mins • 10 pts

 Which Python module is primarily used for file and directory operations?

sys

os

random

shutil

3.

MULTIPLE CHOICE QUESTION

5 mins • 10 pts

 What exception is raised when a file to be opened does not exist?

IOError

KeyError

FileNotFoundError

ValueError

4.

MULTIPLE CHOICE QUESTION

5 mins • 10 pts

What is the main advantage of using the "with" keyword when opening files?

Makes the program faster

Automatically closes the file after operations

Allows writing binary data only

Prevents the need for try-except blocks

5.

MULTIPLE CHOICE QUESTION

5 mins • 10 pts

Which mode should be used to append data to a file without deleting its existing content?

"r"

 "w"

 "a"

"rb"

6.

MULTIPLE CHOICE QUESTION

5 mins • 10 pts

Which method reads the entire content of a file as a single string?

readline()

read()

readlines()

seek()

Answer explanation

read() Reads the whole file content as one single string.

readline() Reads one line at a time (up to a newline \n).

readlines() Reads all lines into a list, where each line is a separate string.

7.

MULTIPLE CHOICE QUESTION

5 mins • 10 pts

he method os.getcwd() in Python is used to:

Delete a directory

Change file ownership

Return the current working directory

Rename a file

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?