Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

PRACTICE PAPER

Multiple Choice Questions

Question 1

Which of the following is an invalid variable?

1. my_day_2
2. 2nd_day ✓
3. Day_two
4. _2

Question 2

Which of the following is not a keyword?

1. eval ✓
2. assert
3. nonlocal
4. pass

Question 3

Which of the following cannot be a variable?

1._init_
2. in ✓
3. it
4. on

Question 4

Which of these is not a core data type?

1. Lists
2. Dictionary
3. Tuples
4. Class ✓

Question 5

How would you write xy in Python as an expression ?

1. x^y
2. x**y ✓
3. x^^y
4. none of these

Question 6

What will be the value of the expression?


14 + 13 % 15

1. 14
2. 27 ✓
3. 12
4. 0

Question 7

Evaluate the expression given below if A = 16 and B = 15.


A % B // A

1. 0.0
2. 0 ✓
3. 1.0
4. 1

Question 8

What is the value of x?


x = int (13.25 + 4/2)

1. 17
2. 14
3. 15 ✓
4. 23
Question 9

The expression 8/4/2 will evaluate equivalent to which of the following expressions:

1. 8/(4/2)
2. (8/4)/2 ✓

Question 10

Which among the following list of operators has the highest precedence?

+, -, **, %, /, <<, >>, |

1. <<, >>
2. ** ✓
3. I
4. %

Question 11

Which of the following expressions results in an error?

1. float('12')
2. int('12')
3. float('12.5')
4. int('12.5') ✓

Question 12

Which of the following statement prints the shown output below?


hello\example\test.txt

1. print("hello\example\test.txt")
2. print("hello\\example\\test.txt") ✓
3. print("hello\"example\"test.txt")
4. print("hello"\example"\test.txt")

Question 13

Which value type does input() return ?


1. Boolean
2. String ✓
3. Int
4. Float

Question 14

Which two operators can be used on numeric values in Python?

1. @
2. % ✓
3. + ✓
4. #

SET-II
Find the valid identifier from the following

a) My-Name b) True c) 2ndName d) S_name

s) S_name

Given the lists L=[1,3,6,82,5,7,11,92] ,

What will be the output of

print(L[2:5])

[6,82,5]

Identify the valid logical operator in Python from the following.

a) ? b) < c) ** d) and

d) and

Suppose a tuple Tup is declared as Tup = (12, 15, 63, 80),

which of the following is incorrect?

a) print(Tup[1])
b) Tup[2] = 90

c) print(min(Tup))

d) print(len(Tup))

b) Tup[2]=90

Name the built-in mathematical function / method that is used to return square root of a number.

sqrt()

Identify the valid declaration of P:

P= [‘Jan’, 31, ‘Feb’, 28]

a. dictionary b. string c.tuple d. list

d) list

If the following code is executed, what will be the output of the following code? str="KendriyaVidyalayaSangathan"

print(str[8:16])

Vidyalay

You might also like