Vidyalelo
Python · all questions

MCQs for Python Data Types and Numeric Types Chapter
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

54

Questions

2/3

Page

Pick an option on a question to see the right answer and solution.

What is the result of 5 / 2 ?

Select an option to see the answer and solution.

Which of the following results in a SyntaxError?

Select an option to see the answer and solution.

What is the imaginary part of the complex number 3 + 4j ?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What is the result of int(3.999) ?

Select an option to see the answer and solution.

What does ~4 evaluate to?

Select an option to see the answer and solution.

What is the output of print 0.1 + 0.2 == 0.3?

Select an option to see the answer and solution.

The following is displayed by a print function call. Select all of the function calls that result in this output.
tom
dick
harry

Select an option to see the answer and solution.

What is the data type of the result of "True" ?

Select an option to see the answer and solution.

What is the result of cmp(3, 1)?

Select an option to see the answer and solution.

What will be the output of the following Python code?
>>>str="hello"
>>>str[:2]
>>>

Select an option to see the answer and solution.

What does ~~~~~~5 evaluate to?

Select an option to see the answer and solution.

What is the result of abs(3 + 4j) ?

Select an option to see the answer and solution.

What is the result of divmod(10, 3) ?

Select an option to see the answer and solution.

What is the result of len("Hello, World!") ?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What is the result of int("5") + float("2.5") ?

Select an option to see the answer and solution.

What is the result of round(0.5) - round(-0.5)?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which of the following is incorrect?

Select an option to see the answer and solution.