Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

XII Practical Exam

Total questions: 12

Worksheet time: 4mins

Name
Class
Date
1.

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","__")

a)

r

b)

a

c)

w

d)

x

2.

which function is used to read records from a binary file?

a)

pickle.load(f)

b)

pickle.read()

c)

pickle.open()

d)

pickle.dump(l,f)

3.

Which file execute faster?

a)

Text file

b)

Binary file

c)

CSV file

4.

The type of operation possible in an opened file is governed by

a)

File Object

b)

File Mode

c)

File Path

d)

open() Method

5.

Function returns the current position of file pointer in the file

a)

tell()

b)

seek()

c)

read()

d)

flush()

6.

How do you change the file position to an offset value from the start?

a)

fp.seek(offset, 0)

b)

fp.seek(offset, 1)

c)

fp.seek(offset, 2)

d)

none of the mentioned

7.

The examples of Linear Data Structures are

a)

Stacks,Queues,Linked list

b)

int,float,complex

c)

Operators,tokens,punctuators

d)

Tree, graph

8.

num1= 10

num2 = 30

(num1<num2) or (num2<0)

a)

true

b)

false

c)

nothing

9.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
10.

If the following code is executed, what will be the output of the following code?

name="ComputerSciencewithPython"

print(name[3:10])

a)

puterSci

b)

puterSc

c)

mputerSc

d)

none

11.

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)

a)

11 15 16

b)

11 16 15

c)

11 15 15

d)

16 11 15

12.

what is the output?

d={0:'a',1:'b',2:'c'}

for i in d:

print(i)

a)

0

1

2

b)

a

b

c

c)

0

a

1

b

2

c

d)

2

a

2

b

2

c