Python Programming
Python fundamentals to advanced for interviews
56 Questions 10 Topics Take Test
Advertisement
Showing 51–56 of 56 questions
Q.51 Medium Basics & Syntax
Which of the following is a mutable data type in Python?
A String
B Integer
C List
D Tuple
Correct Answer:  C. List
EXPLANATION

Lists are mutable, meaning their elements can be changed after creation. Strings, integers, and tuples are immutable.

Take Test
Q.52 Medium Basics & Syntax
What will be the output of: 'Hello' * 2?
A 'HelloHello'
B Error
C 'Hello' concatenated twice
D HelloHello
Correct Answer:  D. HelloHello
EXPLANATION

String multiplication repeats the string. 'Hello' * 2 produces 'HelloHello'.

Take Test
Q.53 Medium Basics & Syntax
Which method is used to add an element to a Python list?
A add()
B append()
C insert()
D Both B and C
Correct Answer:  D. Both B and C
EXPLANATION

append() adds an element at the end, while insert() adds at a specific position. Both are valid methods.

Take Test
Q.54 Medium Basics & Syntax
Which of the following will create an empty dictionary?
A {}
B {:}
C dict()
D Both A and C
Correct Answer:  D. Both A and C
EXPLANATION

{} and dict() both create empty dictionaries. {} is more concise while dict() is explicit.

Take Test
Q.55 Medium Basics & Syntax
Which operator is used for integer division in Python 3?
A /
B //
C %
D **
Correct Answer:  B. //
EXPLANATION

The '//' operator performs floor division and returns an integer, while '/' returns a float in Python 3.

Take Test
Advertisement
Q.56 Medium Basics & Syntax
Which data type is immutable in Python?
A List
B Dictionary
C Tuple
D Set
Correct Answer:  C. Tuple
EXPLANATION

Tuples are immutable sequences in Python. Once created, their elements cannot be modified, unlike lists.

Take Test
IGET
iget AI
Online · Ask anything about exams
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips