Python Programming
Python fundamentals to advanced for interviews
119 Questions 10 Topics Take Test
Advertisement
Showing 91–100 of 119 questions
Q.91 Medium Basics & Syntax
What will be the output of: print(max([3, 1, 4, 1, 5, 9, 2, 6]))?
A 9
B 6
C 8
D 1
Correct Answer:  A. 9
EXPLANATION

The max() function returns the largest element in the list, which is 9.

Take Test
Q.92 Medium Basics & Syntax
Which of the following is a valid variable name in Python?
A 2variable
B var-iable
C var_iable
D var iable
Correct Answer:  C. var_iable
EXPLANATION

Variable names can contain letters, digits, and underscores, but cannot start with a digit or contain hyphens or spaces.

Take Test
Q.93 Medium Basics & Syntax
What will be the output of: print(abs(-5) + abs(3))?
A 2
B 8
C −2
D -8
Correct Answer:  B. 8
EXPLANATION

abs(-5) = 5 and abs(3) = 3. Therefore, 5 + 3 = 8.

Take Test
Q.94 Medium Basics & Syntax
What will be the output of: print(type({}))?
A
B
C
D
Correct Answer:  B.
EXPLANATION

Empty curly braces {} create an empty dictionary, not a set. To create an empty set, use set().

Take Test
Q.95 Medium Basics & Syntax
What will be the output of: x = 5; y = x; y = 10; print(x)?
A 5
B 10
C 15
D Error
Correct Answer:  A. 5
EXPLANATION

x and y are separate variables. Assigning y = 10 doesn't change x, which remains 5.

Take Test
Advertisement
Q.96 Easy Basics & Syntax
Which of the following will correctly concatenate two strings 'Hello' and 'World'?
A 'Hello' + 'World'
B 'Hello' - 'World'
C 'Hello' & 'World'
D 'Hello' | 'World'
Correct Answer:  A. 'Hello' + 'World'
EXPLANATION

The + operator concatenates strings in Python. Other operators don't perform string concatenation.

Take Test
Q.97 Easy Basics & Syntax
What will be the output of: len('hello world')?
A 10
B 11
C 12
D 5
Correct Answer:  B. 11
EXPLANATION

The len() function counts all characters including the space. 'hello world' has 11 characters (including 1 space).

Take Test
Q.98 Easy Basics & Syntax
Which of the following is an immutable data type in Python?
A list
B dictionary
C tuple
D set
Correct Answer:  C. tuple
EXPLANATION

Tuples are immutable, meaning their elements cannot be changed after creation. Lists, dictionaries, and sets are mutable.

Take Test
Q.99 Easy Basics & Syntax
What is the output of: print(10 // 3)?
A 3
B 3.33
C 4
D 3.0
Correct Answer:  A. 3
EXPLANATION

The floor division operator (//) returns the quotient rounded down to the nearest integer. 10 // 3 = 3.

Take Test
Q.100 Easy Basics & Syntax
What will be the output of: print("Python"[2:5])?
A Pyt
B yth
C tho
D hon
Correct Answer:  B. yth
EXPLANATION

String slicing [2:5] extracts characters from index 2 to 4 (5 is exclusive). 'Python'[2:5] = 'yth'.

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