wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

LETS PLAY QUIZ - PYTHON CBSE CLASS XII

Total questions: 20

Worksheet time: 17mins

Name
Class
Date
1.

1. for k in range (2,7) :

print(k, end=' ')

a)

1 2 3 4 5 6

b)

2 3 4 5 6 7

c)

2 3 4 5 6

d)

0 1 2 3 4 5 6

2.

2. str1="Welcome"

>>> print(str1*2)

a)

Wlecome2

b)

2 Welcome

c)

Error

d)

WelcomeWelcome

3.

L=[1,3,6,23,41]

>>> L[2:4]

[6, 23]

a)

[3,6,23,41]

b)

[6,23]

c)

[6,23,41]

d)

[23,41]

4.

What data type is the object below?

L = [1, 23, 'hello', 1]



a)

tuple

b)

array

c)

list

d)

dictionary

5.

which statement makes the loop to forcefully exit

a)

continue

b)

exit

c)

pass

d)

break

6.

Lst=[12,23,41,2,31,45,67,21]

Lst.pop()

a)

12

b)

21

c)

No elements will be popped

d)

1

7.

School = "Sri Chaitanya"

P=len(School)

>>> print (P)

a)

12

b)

13

c)

14

d)

15

8.

def Display(k) :

Answer = k**3 + 42

return Answer

value=2

print(Display(value))

a)

50

b)

51

c)

48

d)

44

9.

def mysum(a,b,c) :

print(a + b +c)


p,q,r = 10,20,30

p,q,r=p+q,q+r,r+p

mysum(p,q,r)

a)

100

b)

110

c)

80

d)

120

10.

count=1

while count<8:

print ( count )

count + = 3

a)

1 2 3 4 5 6 7

b)

1 4 7

c)

1 3 6

d)

1 4 7 10

11.

The data type which returns true or false value

a)

int

b)

float

c)

bool

d)

string

12.

Out of the following whc=ich data type is mutable

a)

int

b)

List

c)

string

d)

float

13.

. What will be the output of the following Python statement?


str1="abcd"

>>>str1[2:]

a)

a

b)

ab

c)

cd

d)

dc

14.

. What arithmetic operators cannot be used with strings?

a)

+

b)

*

c)

-

d)

All of the mentioned

15.

What is the answer to this expression, 22 % 3 is?

a)

7

b)

1

c)

0

d)

5

16.

What will be the output of the following Python code?

x = 'abcd'

for i in range(len(x)):

print(i)

a)

a) a b c d b

b)

b) 0 1 2 3

c)

c) error

d)

d) 1 2 3 4

17.

What will be the output of the following Python code?

def say(message, times = 1):

print(message * times)

say('Hello')

say('World', 5)

a)

Hello

WorldWorldWorldWorldWorld

b)

Hello

World 5

c)

Hello

World,World,World,World,World

d)

Hello

HelloHelloHelloHelloHello

18.

Which of the following is an invalid variable?



a)

a) my_string_1

b)

b) 1st_string

c)

c) sanjeev_prithiv

d)

d) _abc

19.

str1="CBSE BOARD EXAM 2022"

str1.split()

a)

" CBSE BOARD EXAM 2022"

b)

"CBSE","BOARD", "EXAM","2022"

c)

["CBSE","BOARD","EXAM","2022"]

d)

[ CBSE,BOARD,EXAM,2022]

20.

myList = [1, 2, 3, 4, 5, 6]

for i in range(1, 6):

myList[i - 1] = myList[i]

for i in range(0, 6):

print(myList[i], end = " ")

a)

a) 2 3 4 5 6 1


b)

b) 6 1 2 3 4 5

c)

c) 2 3 4 5 6 6

d)

d) 1 1 2 3 4 5