Python Data Types MCQ – 1

Q1) Which statement is correct?

a) List is immutable && Tuple is mutable
b) List is mutable && Tuple is immutable
c) Both are Mutable.
d) Both are Immutable

View Answer Answer:- b) List is mutable && Tuple is immutable

Q2) Which of the following is the example of typecasting?

a) int(3)
b) str(3)
c) str(abc)
d) All of the above

View Answer Answer:- d) All of the above

Q3) What is the data type of print (type(10)) in python?

a) int
b) float
c) integer

View Answer Answer:- a) int

Q4) What is the data type of print(type(0xEE)) in python?

a) int
b) hexint
c) hex
d) number

View Answer Answer:- a) int

Q5) What is the result of print(type([]) is list).

a) True
b) False

View Answer Answer:- a) True

Q6) l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

a) set
b) tupl
c) list
d) None of these

View Answer Answer:- c) list

Q7) Which one of the following is a mutable data type?

a) set
b) tupl
c) int
d) str

View Answer Answer:- a) set

Q8) Which one of the following is an immutable data type?

a) set
b) tupl
c) int
d) str

View Answer Answer:- c) int

Q9) In which data type, indexing is not valid?

a) Dictionary
b) String
c) List
d) None of the above

View Answer Answer:- c) List

Q10) Suppose a list with name arr, contains 3 elements. You can get the 2nd element from the list using:

a) arr[-1]
b) arr[1]
c) arr[2]
d) arr[-2]

View Answer Answer:- b) arr[1]

Q11) Suppose we have a list with name arr, contains 3 elements. How to get the last element of a list in python?

a) arr[0]
b) arr[3]
c) arr[-1]
d) arr[last]

View Answer Answer:- c) arr[-1]

Also See:- MCQ on Data Types in Python– 2

Leave a Comment

Your email address will not be published. Required fields are marked *