➤ How to Code a Game
➤ Array Programs in Java
➤ Java Inline Thread Creation
➤ Java Custom Exception
➤ Hibernate vs JDBC
➤ Object Relational Mapping
➤ Check Oracle DB Size
➤ Check Oracle DB Version
➤ Generation of Computers
➤ XML Pros & Cons
➤ Git Analytics & Its Uses
➤ Top Skills for Cloud Professional
➤ How to Hire Best Candidates
➤ Scrum Master Roles & Work
➤ CyberSecurity in Python
➤ Protect from Cyber-Attack
➤ Solve App Development Challenges
➤ Top Chrome Extensions for Twitch Users
➤ Mistakes That Can Ruin Your Test Metric Program
Q1) Choose the correct option with respect to Python.
a) Both tuples and lists are immutable.
b) Tuples are immutable while lists are mutable.
c) Both tuples and lists are mutable.
d) Tuples are mutable while lists are immutable.
View Answer
Answer:- b) Tuples are immutable while lists are mutable.Q2) Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}
View Answer
Answer:- b) (1, 2, 3)Q3) Which of the following creates a tuple?
a) tuple1 = (“a”,”b”)
b) tuple1[2] = (“a”,”b”)
c) tuple1 = (5)*2
d) None of the above
View Answer
Answer:- a) tuple1 = (“a”,”b”)Q4) Tuples are ____.
a) Mutable
b) Immutable
c) Mutable to some extent
d) None of the above
View Answer
Answer:- b) ImmutableQ5) Select which is true for Python tuple.
a) We cannot change the tuple once created
b) A tuple is unordered
c) We can change the tuple once created
d) All
View Answer
Answer:- a) We cannot change the tuple once createdQ6) Which of the following is not a function of the tuple?
a) max()
b) min()
c) count()
d) update()
View Answer
Answer:- d) update()Q7) Tuples can’t be made keys of a dictionary.
a) True
b) False
View Answer
Answer:- b) FalseQ8) Tuples can contain elements of any data type.(T/F)
a) True
b) False
View Answer
Answer:- a) TrueQ9) Find the output of the given Python program?
>>>t = (1)
>>>type(t)
a) <class ‘int’>
b) <class ‘float’>
c) <class ‘list’>
d) <class ‘tuple’>
View Answer
Answer:- a) < class ‘int’ >Q10) Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))
View Answer
Answer:- b) t[3] = 45Q11) Find the output of the given Python program?
t = (5,4,3,2,1)
x = sum(t,2)
print(x)
a) 15
b) 17
c) 30
d) Error
View Answer
Answer:- b) 17Also See:- MCQ on Python Tuple– 2