
File Handling in Python Quiz

Quiz
•
Computers
•
12th Grade
•
Easy
Shabnam pusa
Used 1+ times
FREE Resource
50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is used to open a file in Python?
fileopen()
open()
fopen()
readfile()
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default mode in which a file is opened using open()?
write
append
read
exclusive
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will file.read() return?
A list of lines
The entire file content as a string
One character
Nothing
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method reads only a single line from the file?
read()
readline()
readlines()
line()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is used to read all lines in a file as a list?
read()
readline()
readlines()
all()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does file.write("Hello") do?
Reads Hello from file
Writes Hello to file
Appends Hello
Deletes Hello
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which mode is used to write to a file (overwriting if exists)?
'r'
'a'
'w'
'rw'
Create a free account and access millions of resources
Similar Resources on Wayground
50 questions
PHOTOSHOP INTRO

Quiz
•
9th - 12th Grade
50 questions
DD(A.G)CCC Sample Assignment

Quiz
•
12th Grade
50 questions
Latihan soal TKJ

Quiz
•
12th Grade
53 questions
The Internet - AP CSP Unit 4

Quiz
•
9th - 12th Grade
45 questions
Quiz TIK

Quiz
•
12th Grade
50 questions
Digital Media II Final Study Guide

Quiz
•
9th - 12th Grade
50 questions
INFORMATIKA X 2024.1 SAS

Quiz
•
10th Grade - University
54 questions
eSkill-8

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade