Python Interview Questions MCQ on Core Concepts. We covered all the Python Interview Questions MCQ on Core Concepts in this post for free so that you can practice well for the exam.
Install our MCQTUBE Android app from the Google Play Store and prepare for any competitive government exams for free.
These MCQs are helpful in computer-related competitive exams.
For your convenience, we created all the competitive exam MCQs into several small posts on our website.
You will get their respective links in the related posts section provided below.
Related Posts:
- Computer MCQ for Class 10 with Answers PDF
- Computer Science MCQ Quiz for Beginners
- Computer Science MCQ Practice Test with Answers
Python Interview Questions MCQ on Core Concepts for Students
Identify the option that is not a proper variable name in Python.
a. my_variable
b. 1st_variable
c. variable 1
d. variable
Option c – variable 1
What does the len()
function return when used on a string?
a. Total number of words
b. Total number of characters
c. Total number of lines
d. Total number of vowels
Option b – Total number of characters
What will be displayed by print(type(3.14))
?
a. int
b. float
c. str
d. bool
Option b – float
Which of these Python data types can be modified after creation?
a. Tuple
b. List
c. String
d. Set
Option b – List
What is the role of the ord()
function in Python?
a. Provides the next value in a sequence
b. Gives the Unicode code for a character
c. Converts a number to binary
d. Calculates the square root of a number
Option b – Gives the Unicode code for a character
Which method will turn all characters in a string to lowercase?
a. strlower()
b. str.upper()
c. str.capitalize()
d. str.lower()
Option a – strlower()
Why is the chr()
function used in Python?
a. Fetches a character from a specific position
b. Transforms a string into lowercase
c. Converts a Unicode value into its character
d. Verifies if a character is a number
Option c – Converts a Unicode value into its character
Choose the correct syntax to define an empty tuple.
a. empty_tuple = ()
b. empty_tuple = []
c. empty_tuple = None
d. empty_tuple =
Option a – empty_tuple = ()
What does print(bool([]))
output?
a. True
b. False
c. None
d. Error
Option b – False
What action does the strip()
method perform on a string?
a. Removes spaces from both ends
b. Breaks a string into a list
c. Joins list elements into a string
d. Converts text to uppercase
Option a – Removes spaces from both ends
Which option shows a proper way to create a set in Python?
a. my_set = {1, 2, 3}
b. my_set = [1, 2, 3]
c. my_set = (1, 2, 3)
d. my_set = {1: 'one', 2: 'two'}
Option a – my_set = {1, 2, 3}
What will be the result of print("Hello" + 3)
?
a. Hello3
b. HelloHelloHello
c. Error
d. None
Option a – Hello3
What is the outcome of the expression 5 % 2
?
a. 2.5
b. 2
c. 1
d. 1.5
Option c – 1
How can you determine the number of items in a list?
a. length(list)
b. size(list)
c. len(list)
d. list.length()
Option c – len(list)
After executing True + 5
, what is the type of the result?
a. int
b. float
c. bool
d. str
Option a – int
What will be displayed when print("apple" "banana")
is executed in Python?
a. True
b. False
c. Error
d. applebanana
Option b – False
What type does type(range(5))
return in Python?
a. int
b. float
c. list
d. range
Option d – range
Why is the count()
function used in Python?
a. To get the total number of items in a list
b. To count how many times a certain value appears
c. To find the number of distinct items in a list
d. To calculate how many items are in a tuple
Option b – To count how many times a certain value appears
Which method correctly defines a constant in Python?
a. CONSTANT = 10
b. constant(10)
c. Const = 10
d. All the given options
Option a – CONSTANT = 10
What does list("Python")
return?
a. “Python”
b. [‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’]
c. (‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’)
d. Error
Option b – [‘P’, ‘y’, ‘t’, ‘h’, ‘o’, ‘n’]
What will be the output of "Python".find("th")
?
a. -1
b. 0
c. 2
d. 3
Option c – 2
How can you check if a string contains only letters in Python?
a. string.is_alpha()
b. string.is_alpha
c. string.isalpha()
d. is_alpha(string)
Option c – string.isalpha()
What does 10 // 3
evaluate to in Python?
a. 3
b. 3.0
c. 3
d. 3.3333333333333335
Option c – 3
Choose the correct way to define a tuple with three items.
a. my_tuple = 1, 2, 3
b. my_tuple = (1, 2, 3)
c. my_tuple = [1, 2, 3]
d. mytuple = {1: ‘one’, 2: ‘two’, 3: ‘three’}
Option b – my_tuple = (1, 2, 3)
What will print("Python"[-2:])
display?
a. On
b. th
c. On
d. on
Option a – On
Which method converts a string into a list of individual characters?
a. list(string)
b. string.to_list()
c. string.split()
d. list(string)
Option a – list(string)
What result do you get from print("apple" "banana")
?
a. True
b. False
c. Error
d. applebanana
Option b – False
What is the outcome of evaluating 5 + 3 * 2
?
a. 16
b. 26
c. 11
d. 15
Option c – 11
Which way checks if all characters in a string are numeric?
a. string.isnumeric()
b. string.isdigit()
c. string.isnumeric
d. isnumeric(string)
Option a – string.isnumeric()
What does the clear()
method do when called on a list?
a. Deletes the last item
b. Empties the entire list
c. Adds an item to the list
d. Deletes the first item
Option b – Empties the entire list
What will happen when you try to evaluate 5 + '3'
in Python?
a. 8
b. ’53’
c. 35
d. Error
Option d – Error
How do you properly define a variable in Python?
a. variable x = 10
b. x = 10
c. int x = 10
d. let x = 10
Option b – x = 10
Which symbol performs a bitwise XOR operation in Python?
a. ^
b. &
c. |
d. ~
Option a – ^
Which of these correctly checks if a number is even in Python?
a. x % 2 == 0
b. x.is_even()
c. iseven(x)
d. All of the above
Option a – x % 2 == 0
What is the output of 10 / 3.0
in Python?
a. 3.3333333333333335
b. 3.0
c. 3
d. 3.333
Option a – 3.3333333333333335
In Python 2.x, which symbol is used for exponentiation?
a. **
b. ^
c. pow()
d. ex
Option a – **
What does the expression True or False
return in Python?
a. True
b. False
c. None
d. Error
Option a – True
What is the outcome of not (False and True)
in Python?
a. True
b. False
c. None
d. Error
Option a – True
How can you create a list containing numbers from 1 to 5 in Python?
a. [1, 2, 3, 4, 5]
b. list(1, 5)
c. range(1, 5)
d. All of the above
Option a – [1, 2, 3, 4, 5]
What does 5 == '5'
evaluate to in Python?
a. True
b. False
c. None
d. Error
Option a – True
Which operator represents bitwise AND in Python?
a. &
b. |
c. ^
d. ~
Option a – &
Choose the correct syntax to define a tuple with values 1, 2, and 3:
a. my_tuple = (1, 2, 3)
b. my_tuple = [1, 2, 3]
c. my_tuple = (1, 2, 3}
d. my_tuple = 1, 2, 3
Option a – my_tuple = (1, 2, 3)
What is the result of 3 // 2
in Python?
a. 1.5
b. 1
c. 2
d. 1.0
Option b – 1
Which operator is used to repeat a string multiple times in Python?
a. +
b. *
c. /
d. –
Option b – *
What does 2.5 // 2
return in Python?
a. 1.25
b. 1
c. 2
d. 1.0
Option b – 1
What is the result of 5 / 2
in Python 2.x?
a. 2.5
b. 2
c. 2.0
d. 2.5
Option b – 2
Which symbol is used for slicing strings in Python?
a. :
b. ::
c. ..
d. ->
Option a – :
What does 10 % 3
give in Python?
a. 3.33333
b. 3.3333335
c. 1
d. 3
Option c – 1
What value is returned by the expression 5 * 2 - 3
in Python?
a. 7
b. 8
c. 10
d. Error
Option a – 7
Which symbol is used in Python to join two strings together?
a. +
b. *
c. /
d. –
Option a – +
What is the output of print("Hello" + " + "World")
in Python?
a. HelloWorld
b. Hello World
c. Hello+World
d. Error
Option b – Hello World
What is the result when you evaluate 2 ** 3
in Python?
a. 6
b. 9
c. 8
d. 5
Option c – 8
What does print(10 % 3)
display in Python?
a. 0
b. 1
c. 2
d. 3
Option b – 1
Which operator performs a bitwise OR in Python?
a. |
b. &
c. A
d. ~
Option a – |
Evaluate the result of 7 | 3
in Python.
a. 4
b. 7
c. 3
d. 0
Option b – 7
What is the purpose of the in
keyword in Python?
a. To check membership in a sequence
b. For exponentiation
c. To compare identity
d. To perform a bitwise OR
Option a – To check membership in a sequence
What will be printed by print(3 in [1, 2, 3])
?
a. True
b. False
c. None
d. Error
Option a – True
Which operator checks if two values are unequal in Python?
a. !=
b. <>
c. =!
d. =/=
Option c – =!
What result do you get from 5 != 2
in Python?
a. True
b. False
c. None
d. Error
Option b – False
What is the role of the is
keyword in Python?
a. Tests for presence in a sequence
b. Used for exponentiation
c. Compares object identity
d. Executes a bitwise OR
Option c – Compares object identity
What does print([] is [])
output in Python?
a. True
b. False
c. None
d. Error
Option b – False
Which symbol represents bitwise NOT in Python?
a. |
b. &
c. ^
d. ~
Option d – ~
What value results from evaluating -5
in Python?
a. -6
b. 5
c. -5
d. 6
Option a – -6
What function does the or
keyword serve in Python?
a. Performs a bitwise OR
b. Executes a logical OR
c. Does a bitwise AND
d. Carries out a logical AND
Option b – Executes a logical OR
What will print(10 or 20)
produce in Python?
a. 10
b. 20
c. True
d. False
Option a – 10
Which operator performs a left shift in Python?
a. <<
b. >>
c. &
d. |
Option a – <<
What is the outcome of 8 << 2
in Python?
a. 32
b. 16
c. 64
d. 4
Option b – 16
What will print("Python"[:3])
return?
a. Pyt
b. pyt
c. Py
d. Error
Option a – Pyt
What does the sorted()
function do in Python?
a. Sorts a list in descending order
b. Sorts a list in ascending order
c. Sorts a dictionary based on its keys
d. Reverses the order of elements in a list
Option b – Sorts a list in ascending order
How can you find the maximum value in a list in Python?
a. max(list)
b. list.max()
c. maximum(list)
d. list.maximum()
Option a – max(list)
What will print("Python".lower())
display in Python?
a. python
b. Python
c. PYTHON
d. pYTHON
Option a – python
What is the result of print(type(True))
in Python?
a. int
b. float
c. bool
d. str
Option c – bool
How can you create an empty tuple in Python?
a. empty_tuple = []
b. empty_tuple =
c. empty_tuple = ()
d. empty_tuple = [None]
Option c – empty_tuple = ()
What is the outcome of the expression 3 * 'a'
in Python?
a. ‘aaa’
b. 3
c. ‘aaaa’
d. Error
Option a – ‘aaa’
Which of the following is the correct way to create an empty dictionary in Python?
a. empty_dict = )
b. empty_dict = dict()
c. empty_dict = ()
d. empty_dict = []
Option b – empty_dict = dict()
What will the expression 3 < 5 or 2 < 4
evaluate to in Python?
a. True
b. False
c. 2
d. Error
Option a – True
How can you check if a variable is of a specific type in Python?
a. type(var) == 'int'
b. isinstance(var, int)
c. var.type() == int
d. typeof(var) == 'int'
Option b – isinstance(var, int)
What is the result of 5 + 2 * 3
in Python?
a. 15
b. 11
c. 15
d. Error
Option b – 11
What will print("Hello" * -3)
output in Python?
a. HelloHelloHello
b. Error
c. None
d. Hello
Option c – None
How can you check if a key is not in a dictionary in Python?
a. key not in dict
b. not key in dict
c. key in not dict
d. key.exists(dict)
Option a – key not in dict
What is the result of print(type(True + 5))
in Python?
a. int
b. float
c. bool
d. str
Option a – int
What does the expression 3 + 5 * 2
evaluate to in Python?
a. 16
b. 26
c. 13
d. 18
Option c – 13
How do you perform bitwise XOR in Python?
a. |
b. &
c. ^
d. ~
Option c – ^
What is the result of 7 ^ 3
in Python?
a. 4
b. 7
c. 3
d. 0
Option a – 4
How do you convert a string to uppercase in Python?
a. str.uppercase()
b. string.toUpper()
c. str.upper()
d. uppercase(str)
Option c – str.upper()
Which function is responsible for overloading the >>
operator?
a. more()
b. gt()
c. ge()
d. None of the above
Option d – None of the above
What is the result of the expression 100 / 25
?
a. 4
b. 4.0
c. 0
d. 25
Option a – 4
Which of the following represents floor division?
a. //
b. /
c. %
d. None of the above
Option a – //
Which operator is affected by the or()
function overload?
a. ||
b. |
c. //
d. /
Option d – /
Is it appropriate to use the ==
operator for comparing floating-point numbers?
a. Yes
b. No
Option a – Yes
How are operators with the same precedence evaluated?
a. From left to right
b. From right to left
c. The evaluation order can’t be determined
d. None of the above
Option a – From left to right
Which of the following operators has the highest precedence in Python?
a. not
b. &
c. *
d. +
Option c – *
When a function does not return any value, what will be displayed in the shell?
a. int
b. bool
c. void
d. None
Option d – None
We covered all the Python Interview Questions MCQ on Core Concepts above in this post for free so that you can practice well for the exam.
Check out the latest MCQ content by visiting our mcqtube website homepage.
Also, check out: