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

OBJECTIVE TYPE QUESTIONS

Mark
Multiple Choice Questions
1. Is Python case sensitive when dealing with identifiers ?
(a) yes (b) no
(c) machine dependent (d) none of the mentioned
Which of the following is an invalid variable ?
(a) my_day_2 (b) 2nd_day (c) Day_two (d)2
Which of the following is not a keyword ?
(a) eval (6) assert (c) nonlocal (d) pass
4Which of the following cannot be a variable
(a) init (b) in (c) it (d) on
Which of these is not a core data type ?
(a) Lists (6) Dictionary () Tuples (d) Class
6. How would you write x in Python as an expression?
(a) x^y (b) x**y
(c)xAy (d) none of these
Which of the following is an invalid statement?
(a) abc 1,000,000 (b) a b c = 1000 2000 3000

c ) a, b, c = 1000, 2000, 3000 (d) a = b = c =1,000,000

Which value type does input( ) return?


(a) Boolean (6) String (c) Int (d) Float

Given a function that does not return any value, what value is thrown by detau
when executed in shell ?
(a) int (b) bool (c) void (d) none

10. What will be the value of the expression ?

14+13% 15
(a) 14 (b) 27 ()12 (d) 0

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

A %B// A
(a) 0.0 (b) 0 (c) 1.0 (d) 1
12. What is the value of x?

x = int(13.25 +4/2)

(a) 17 (b) 14 (c) 15 (d) 23


13. The expression 8/4/2 will evaluate equivalent to which of the following ior*

(a) 8/(4/2) (b) (8/4)/2


UNIT I: PROGRAMMING AND COMPUTATIONAL THINKING

14. Which among the following list of operators has the highest precedence?
%,, , >, |
( a ) , >> (6) **

(c) (d) %
15. Which of the following expressions results in an error ?
(a) float(12) (6) int("12') (c) float("12.5') (d) int(12.5)
16. Which of the following statement prints the shown output below ?

hello\example\test.txt
(a) print("hello \example \ test.bxt") 6) print("hello\ \example\ \ test.txt)
(c) print("hello\ "example\ "test.bxt") (d) print("hello"\ example"\test.bxt")
17. In Python we do not specify types, it is directly interpreted by the compiler, so
consider the following operation to be performed.
>x = 33 <operator >4
What would you fill in place of soperator> in the above expression so that x has an
integer value ? Select all that apply (Python 3.xx)
(a) // (6) (c) % (d) All of the mentioned
18. Which two operators can be used on numeric values in Python ?

(a)@ (b) % (c)+ (d)#


19 Which of the following four code fragments will yield the following output ?

Eina
Mina
Dika
Select all of the function calls that result in this output

(a) print( 'Eina

\nMina
\nDika" ' ")

(6) p r i t ( " * "EinaMinaDika" **)

c) print( 'Eina\nMina\nDika')

(d) print( "Eina

Mina
Dika')
is valid arithmetic operator in Python ?
20. Which of the following
(b) ? (c) (d) and
(a) //
whether two variables are the same ?
21. Which operator is used to check

(a) (b)
of these is floor division operator ?
22. Which one a

(c) (d) None of the mentioned


(a)/ (b) /
22 % 3 is ?
23. What is the value of this expression:
(c) 1.0 (d) 7.0
(a) 7 (b) 1

the value of this expression : 22% 3.0 is?


24. What is
(c) 1.0 (d) 7.0
(a) 7 (6) 1

You might also like