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

## ```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

(A) list
(B) dictionary
(C) array
(D) tuple

(A) list
(B) tuple
(C) class
(D) dictionary

## `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”’

(A) 85.0
(B) 85.1
(C) 95.0
(D) 95.1

(A) int
(B) bool
(C) float
(D) none

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

(A) true
(B) false
(C) machine dependent
(D) error

## `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

## `Q. 40) What is the type of inf?`

(A) boolean
(B) integer
(C) float
(D) complex

Download our easy to use, user friendly Android App from Play Store. And learn MCQs with one click.