iGET

Python Programming - MCQ Practice Questions

Core Python MCQs — syntax, data types, OOP, libraries for placements & IT exams.

119 questions | 100% Free

Q.21Easy

What does the len() function return when applied to a string 'India'?

Q.22Easy

Consider the code: num = '123'. What will int(num) return?

Q.23Easy

Which of the following is the correct syntax for a Python comment?

Q.24Easy

What is the output of: print('Hello' + ' ' + 'World')?

Q.25Easy

Which method is used to add an element to a list in Python?

Q.26Easy

What will be the output of: print(10 // 3)?

Q.27Easy

Which of the following is NOT a valid Python variable name?

Q.28Easy

What is the output of: print(10 // 3 + 10 % 3)?

Q.29Easy

What will be the data type of x after executing: x = ?

Q.30Easy

What is the output of: print(len('Python'))?

Q.31Easy

What will be the output of: print(10 if 5 > 3 else 20)?

Q.32Easy

What is the output of: print('a' in 'banana')?

Q.33Easy

What will be the output of: x = 5; x += 3; print(x)?

Q.34Easy

What will be the output of the following code? my_list = [1, 2, 3] my_list.append(4) print(len(my_list))

Q.35Easy

Which of the following is NOT a valid Python data type?

Q.36Easy

What will be the type of x after executing: x = [1, 2.5, 'hello']?

Q.37Easy

Which method removes and returns the last element from a list?

Q.38Easy

What will be the output? my_list = [1, 2, 3, 4, 5] print(my_list[1:3])