Home / Engineering / Problem Solving and Python Programming MCQs / Page 6

Problem Solving and Python Programming MCQs | Page - 6

Dear candidates you will find MCQ questions of Problem Solving and Python Programming here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.

Q. 51) What will be the output of the following
Python code?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]

(A) olleh
(B) hello
(C) h
(D) o
View Answer Discuss Share

Q. 52) What arithmetic operators cannot be used with strings?

(A) +
(B) *
(C) –
(D) all of the mentioned
View Answer Discuss Share

Q. 53) What will be the output of the following Python code? >>>print (r"\nhello")

(A) a new line and hello
(B) \\nhello
(C) the letter r and then hello
(D) error
View Answer Discuss Share

Q. 54) What will be the output of the following Python code? >>>print('new' 'line')

(A) error
(B) output equivalent to print ‘new\\nline’
(C) newline
(D) new line
View Answer Discuss Share

Q. 55) What will be the output of the following
Python code?
1. >>>str1="helloworld"
2. >>>str1[::-1]

(A) dlrowolleh
(B) hello
(C) world
(D) helloworld
View Answer Discuss Share

Q. 56) What will be the output of the following
Python code?
print(0xA + 0xB + 0xC)

(A) 0xa0xb0xc
(B) error
(C) 0x22
(D) 33
View Answer Discuss Share

Q. 57) What will be the output of the following
Python code?
1. class father:
2. def __init__(self, param):
3. self.o1 = param
4.
5. class child(father):
6. def __init__(self, param):
7. self.o2 = param
8.
9. >>>obj = child(22)
10. >>>print "%d %d" % (obj.o1, obj.o2)

(A) none none
(B) none 22
(C) 22 none
(D) error is generated
View Answer Discuss Share

Q. 58) What will be the output of the following
Python code?
1. class tester:
2. def __init__(self, id):
3. self.id = str(id)
4. id="224"
5.
6. >>>temp = tester(12)
7. >>>print(temp.id)

(A) 224
(B) error
(C) 12
(D) none
View Answer Discuss Share

Q. 59) 3. What will be the output of the following
Python code?
1. >>>example = "snow world"
2. >>>print("%s" % example[4:7])

(A) wo
(B) world
(C) sn
(D) rl
View Answer Discuss Share

Q. 60) What will be the output of the following
Python code?
1. >>>example = "snow world"
2. >>>example[3] = 's'
3. >>>print example

(A) snow
(B) snow world
(C) error
(D) snos world
View Answer Discuss Share

Explore Sets

Problem Solving and Python Programming MCQs Set 1

Problem Solving and Python Programming MCQs Set 2

Problem Solving and Python Programming MCQs Set 3

Problem Solving and Python Programming MCQs Set 4

Problem Solving and Python Programming MCQs Set 5

Problem Solving and Python Programming MCQs Set 6

Problem Solving and Python Programming MCQs Set 7

Problem Solving and Python Programming MCQs Set 8

Problem Solving and Python Programming MCQs Set 9

Problem Solving and Python Programming MCQs Set 10

Problem Solving and Python Programming MCQs Set 11

Problem Solving and Python Programming MCQs Set 12

Problem Solving and Python Programming MCQs Set 13

Problem Solving and Python Programming MCQs Set 14

Problem Solving and Python Programming MCQs Set 15

Problem Solving and Python Programming MCQs Set 16

Problem Solving and Python Programming MCQs Set 17

Problem Solving and Python Programming MCQs Set 18

Problem Solving and Python Programming MCQs Set 19

Problem Solving and Python Programming MCQs Set 20

Problem Solving and Python Programming MCQs Set 21

Problem Solving and Python Programming MCQs Set 22

Problem Solving and Python Programming MCQs Set 23

Problem Solving and Python Programming MCQs Set 24

Problem Solving and Python Programming MCQs Set 25

Problem Solving and Python Programming MCQs Set 26

Problem Solving and Python Programming MCQs Set 27

Problem Solving and Python Programming MCQs Set 28

Problem Solving and Python Programming MCQs Set 29

Problem Solving and Python Programming MCQs Set 30

Problem Solving and Python Programming MCQs Set 31

Problem Solving and Python Programming MCQs Set 32

Problem Solving and Python Programming MCQs Set 33

Problem Solving and Python Programming MCQs Set 34

Problem Solving and Python Programming MCQs Set 35

Problem Solving and Python Programming MCQs Set 36

Problem Solving and Python Programming MCQs Set 37

Problem Solving and Python Programming MCQs Set 38

Problem Solving and Python Programming MCQs Set 39

Problem Solving and Python Programming MCQs Set 40

Problem Solving and Python Programming MCQs Set 41

Problem Solving and Python Programming MCQs Set 42

Problem Solving and Python Programming MCQs Set 43