Computer

Data Types And Numeric Types MCQs

Practice Data Types And Numeric Types MCQs for competitive exams.

Data Types And Numeric Types MCQs

Practice questions from this topic.

What does 3 ^ 4 evaluate to?

  1. A. 81
  2. B. 12
  3. C. 0.75
  4. D. 7
Report Error

Select all options that print. hello-how-are-you

  1. A. print('hello', 'how', 'are', 'you')
  2. B. print('hello', 'how', 'are', 'you' + '-' * 4)
  3. C. print('hello-' + 'how-are-you')
  4. D. print('hello' + '-' + 'how' + '-' + 'are' + 'you')
Report Error

What is the result of float("3.14") ?

  1. A. 3.0
  2. B. "3.14"
  3. C. 3.14
  4. D. "3"
Report Error

What will be the output of the following Python code snippet? def example(a): a = a + '2' a = a*2 return a >>>example("hello")

  1. A. indentation Error
  2. B. cannot perform mathematical operation on strings
  3. C. hello2
  4. D. hello2hello2
Report Error

Which of the following is not a complex number?

  1. A. k = 2 + 3j
  2. B. k = complex(2, 3)
  3. C. k = 2 + 3l
  4. D. k = 2 + 3J
Report Error

What is the result of (3 + 4j) * (1 - 2j) ?

  1. A. -5 - 5j
  2. B. -1 + 10j
  3. C. -1 - 10j
  4. D. 5 + 5j
Report Error

What is the return type of function id?

  1. A. int
  2. B. float
  3. C. bool
  4. D. dict
Report Error

What is the purpose of the complex() function in Python?

  1. A. To create complex numbers
  2. B. To perform complex calculations
  3. C. To convert numbers to strings
  4. D. To round floating-point numbers
Report Error

What error occurs when you execute the following Python code snippet? apple = mango

  1. A. SyntaxError
  2. B. NameError
  3. C. ValueError
  4. D. TypeError
Report Error

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

  1. A. x = 13 // 2
  2. B. x = int(13 / 2)
  3. C. x = 13 % 2
  4. D. All of the mentioned
Report Error

Which of the following will run without errors?

  1. A. round(45.8)
  2. B. round(6352.898,2,5)
  3. C. round()
  4. D. round(7463.123,2,1)
Report Error

What is the result of round(3.14159, 2) ?

  1. A. 3.14
  2. B. 3.15
  3. C. 3.1
  4. D. 3.141
Report Error