
24-25 file handling

Quiz
•
Computers
•
11th Grade
•
Hard
Deepti Gupta
Used 1+ times
FREE Resource
27 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To open a file c:\test.txt for reading, we should give the statement:
file1 = open(“c:\test.txt”,”r”)
file1 = open(“c:\\test.txt”,”r”)
file1 = open(file=”c:\test.txt”,”r”)
file1 = open(file=”c:\\s test.txt”,”r”)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To open a file c:\ test.txt for writing, we should use the statement:
fobj = open(“c:\test.txt”,”w”)
fobj = open(“c:\\test.txt”,”w”)
fobj = open(file=”c:\test.txt”,”w”)
fobj = open(file=”c:\\test.txt”,”w”)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To open a file c:\ test.txt for appending data, we can give the statement:
fobj = open(“c:\\test.txt”,”a”)
fobj = open(“c:\\test.txt”,”rw”)
fobj = open(file=“c:\test.txt”,”w”)
fobj = open(file=“c:\\ test.txt”,”w”)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is/are true?
when we open a file for reading, if the file does not exist, an error occurs.
when we open a file for writing, if the file does not exist, a new file is created.
when we open a file for writing, if the file exists, the existing file is overwritten with the new file.
All of these
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To read the entire contents of the file as a string from a file object fobj, the command should be:
fobj.read(2)
fobj.read()
fobj.readline()
fobj.readlines()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following snippet?
True
False
None
Error
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
PTS Informatika

Quiz
•
9th Grade - University
23 questions
2.02 Multimedia Media Webpage Design

Quiz
•
9th - 12th Grade
22 questions
Utility Software

Quiz
•
KG - University
30 questions
PNHS - ICT Quiz Bee (Elimination) - EASY ROUND

Quiz
•
9th - 12th Grade
32 questions
IT- Chapter. 8

Quiz
•
9th - 12th Grade
25 questions
KELAS 9 BAB 3 BEKERJA DENGAN DATA DAN MODEL KOMPUTASI

Quiz
•
9th Grade - University
26 questions
LPI Linux Ch 14 Permissions

Quiz
•
9th - 12th Grade
30 questions
Technology: Internet & Apps

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

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade