WorksheetsXII Practical Exam
Total questions: 12
Worksheet time: 4mins
Mode in the following program to open file for writing in a mode where new data will be added at the end of old data
file =open("poem.txt","__")
r
a
w
x
which function is used to read records from a binary file?
pickle.load(f)
pickle.read()
pickle.open()
pickle.dump(l,f)
Which file execute faster?
Text file
Binary file
CSV file
The type of operation possible in an opened file is governed by
File Object
File Mode
File Path
open() Method
Function returns the current position of file pointer in the file
tell()
seek()
read()
flush()
How do you change the file position to an offset value from the start?
fp.seek(offset, 0)
fp.seek(offset, 1)
fp.seek(offset, 2)
none of the mentioned
The examples of Linear Data Structures are
Stacks,Queues,Linked list
int,float,complex
Operators,tokens,punctuators
Tree, graph
num1= 10
num2 = 30
(num1<num2) or (num2<0)
true
false
nothing
If the following code is executed, what will be the output of the following code?
name="ComputerSciencewithPython"
print(name[3:10])
puterSci
puterSc
mputerSc
none
What is the output?
a=[5,10,15,20,25]
k=1
i=a[1]+1
j=a[2]+1
m=a[k+1]
print(i,j,m)
11 15 16
11 16 15
11 15 15
16 11 15
what is the output?
d={0:'a',1:'b',2:'c'}
for i in d:
print(i)
0
1
2
a
b
c
0
a
1
b
2
c
2
a
2
b
2
c
