
Computer Science Revision 1
Authored by Vatsala Dadeech
Computers
12th Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
44 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the invalid identifier from the following
None
address
Name
pass
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider a declaration L = (1, 'Python', '3.14'). Which of the following represents the data type of L?
list
tuple
dictionary
string
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given a Tuple tup1= (10, 20, 30, 40, 50, 60, 70, 80, 90). What will be the output of print (tup1 [3:7:2])?
(40,50,60,70,80)
(40,50,60,70)
[40,60]
(40,60)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following option is not correct?
if we try to read a text file that does not exist, an error occurs.
if we try to read a text file that does not exist, the file gets created.
if we try to write on a text file that does not exist, no error occurs.
if we try to write on a text file that does not exist, the file gets Created.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following options can be used to read the first line of a text file Myfile.txt?
myfile = open('Myfile.txt'); myfile.read()
myfile = open('Myfile.txt','r'); myfile.read(n)
myfile = open('Myfile.txt'); myfile.readline()
myfile = open('Myfile.txt'); myfile.readlines()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assume that the position of the file pointer is at the beginning of 3rd line in a text file. Which of the following option can be used to read all the remaining lines?
myfile.read()
myfile.read(n)
myfile.readline()
myfile.readlines()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A text file student.txt is stored in the storage device. Identify the correct option out of the following options to open the file in read mode.
myfile = open('student.txt','rb')
myfile = open('student.txt','w')
myfile = open('student.txt','r')
myfile = open('student.txt')
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?