MCQS Ip 11
MCQS Ip 11
Page No 2
CHAPTER 2 - PYTHON FUNDAMENTALS
Page No 3
5. Mathematical operations can be performed on a string. State whether true or
false.
a) True
b) False
9. The expression Int(x) implies that the variable x is converted to integer. State
whether true or false.
a) True
b) False
10. Which one of the following have the highest precedence in the expression?
a) Exponential
b) Addition
c) Multiplication
d) Parentheses
Page No 4
CHAPTER 3 – DATA HANDLING
3. Following set of commands are executed in shell, what will be the output?
>>>str="hello"
>>>str[:2]
>>>
a) he
b) lo
c) olleh
d) hello
Page No 5
8. Carefully observe the code and give the answer.
def example(a):
a = a + '2'
a = a*2
return a
>>>example("hello")
a) indentation Error
b) cannot perform mathematical operation on strings
c) hello2
d) hello2hello2
a) list
b) dictionary
c) array
d) tuple
10. In order to store values in terms of key and value we use what core data type.
a) list
b) tuple
c) class
d) dictionary
12. What is the average value of the code that is executed below ?
>>>grade1 = 80
Page No 6
>>>grade2 = 90
>>>average = (grade1 + grade2) / 2
a) 85
b) 85.1
c) 95
d) 95.1
hello-how-are-you
Page No 7
19. What does ~~~~~~5 evaluate to?
a) +5
b) -11
c) +11
d) -5
Page No 8