Python MCQ’s | Data types 1

This set of Python Multiple Choice Questions & Answers (MCQs) focuses on “Core Data Types”.

 

1.
Which of these in not a core data type?

a) Lists
b) Dictionary
c) Tuples
d) Class

2.
Given a function that does not return any value, What value is thrown by default when executed in shell.

a) int
b) bool
c) void
d) None

3.
What will be the output of the following Python code?

>>>str=”hello”
>>>str[:2]
>>>
a) he
b) lo
c) olleh
d) hello

4.
Which of the following will run without errors?

a) round(45.8)
b) round(6352.898,2,5)
c) round()
d) round(7463.123,2,1)

5.
What is the return type of function id?

a) int
b) float
c) bool
d) dict