On This Page

This set of Problem Solving and Python Programming Multiple Choice Questions & Answers (MCQs) focuses on Problem Solving And Python Programming Set 3

Q1 | Operators with the same precedence are evaluated in which manner?
  • left to right
  • right to left
  • can’t say
  • none of the mentioned
Q2 | What is the output of this expression, 3*1**3?
  • 27
  • 9
  • 3
  • 1
Q3 | Which one of the following has the same precedence level?
  • addition and subtraction
  • multiplication, division and addition
  • multiplication, division, addition and subtraction
  • addition and multiplication
Q4 | The expression Int(x) implies that the variable x is converted to integer.
  • true
  • false
Q5 | Which one of the following has the highest precedence in the expression?
  • exponential
  • addition
  • multiplication
  • parentheses
Q6 | Which of these in not a core data type?
  • lists
  • dictionary
  • tuples
  • class
Q7 | Given a function that does not return any value, What value is thrown by default when executed in shell.
  • int
  • bool
  • void
  • none
Q8 | 3 DATA TYPES
  • he
  • lo
  • olleh
  • hello
Q9 | Which of the following will run without errors?
  • round(45.8)
  • round(6352.898,2,5)
  • round()
  • round(7463.123,2,1)
Q10 | What is the return type of function id?
  • int
  • float
  • bool
  • dict
Q11 | >>>x = 13 ? 2
  • x = 13 // 2
  • x = int(13 / 2)
  • x = 13 % 2
  • all of the mentioned
Q12 | >>>example("hello")
  • indentation error
  • cannot perform mathematical operation on strings
  • hello2
  • hello2hello2
Q13 | , 23, 'hello', 1]
  • list
  • dictionary
  • array
  • tuple
Q14 | In order to store values in terms of key and value we use what core data type.
  • list
  • tuple
  • class
  • dictionary
Q15 | Which of the following results in a SyntaxError?
  • ‘”once upon a time…”, she said.’
  • “he said, ‘yes!\” c) ‘3\\’
  • d) ”’that’s okay”’
Q16 | >>>average = (grade1 + grade2) / 2
  • 85.0
  • 85.1
  • 95.0
  • 95.1
Q17 | What is the return value of trunc()?
  • int
  • bool
  • float
  • none
Q18 | What is the output of print 0.1 + 0.2 == 0.3?
  • true
  • false
  • machine dependent
  • error
Q19 | Which of the following is not a complex number?
  • k = 2 + 3j
  • k = complex(2, 3)
  • k = 2 + 3l
  • k = 2 + 3j
Q20 | What is the type of inf?
  • boolean
  • integer
  • float
  • complex
Q21 | What does ~4 evaluate to?
  • -5
  • -4
  • -3
  • +3
Q22 | What is the result of cmp(3, 1)?
  • 1
  • 0
  • true
  • false
Q23 | Which of the following is incorrect?
  • float(‘inf’)
  • float(‘nan’)
  • float(’56’+’78’)
  • float(’12+34′)
Q24 | What is the result of round(0.5) – round(-0.5)?
  • 1.0
  • 2.0
  • 0.0
  • value depends on python version
Q25 | What does 3 ^ 4 evaluate to?
  • 81
  • 12
  • 0.75
  • 7