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

Problem Solving and Python Programming MCQs | Page - 4

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. 31) In python we do not specify types, it is
directly interpreted by the compiler, so
consider the following operation to be
performed.
>>>x = 13 ? 2
objective is to make sure x has a integer
value, select all that apply (python 3.xx)

(A) x = 13 // 2
(B) x = int(13 / 2)
(C) x = 13 % 2
(D) all of the mentioned
View Answer Discuss Share

Q. 32) what will be the output of the following
Python code snippet?
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
View Answer Discuss Share

Q. 33) What data type is the object below? L = [1, 23, 'hello', 1]

(A) list
(B) dictionary
(C) array
(D) tuple
View Answer Discuss Share

Q. 34) 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
View Answer Discuss Share

Q. 35) Which of the following results in a SyntaxError?

(A) ‘”once upon a time…”, she said.’
(B) “he said, ‘yes!\”
(C) ‘3\\’
(D) ”’that’s okay”’
View Answer Discuss Share

Q. 36) What is the average value of the
following Python code snippet?
>>>grade1 = 80
>>>grade2 = 90
>>>average = (grade1 + grade2) / 2

(A) 85.0
(B) 85.1
(C) 95.0
(D) 95.1
View Answer Discuss Share

Q. 37) What is the return value of trunc()?

(A) int
(B) bool
(C) float
(D) none
View Answer Discuss Share

Q. 38) What is the output of print 0.1 + 0.2 == 0.3?

(A) true
(B) false
(C) machine dependent
(D) error
View Answer Discuss Share

Q. 39) Which of the following is not a complex number?

(A) k = 2 + 3j
(B) k = complex(2, 3)
(C) k = 2 + 3l
(D) k = 2 + 3j
View Answer Discuss Share

Q. 40) What is the type of inf?

(A) boolean
(B) integer
(C) float
(D) complex
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