1. How will you write x to the power y in python?
ANSWER= c)Explain:- ** is used for exponent in python.Exponent - left operand raised to the power of right (e.g. x**y)
2. What will be output of 15//4 in python ?
ANSWER= c) // Floor division - division that results into whole number adjusted to the left in the number line
Explain:-
3. What will be output of 15/4 in python ?
ANSWER= A)
Explain:- / Divide left operand by the right one (always results into float)
4. What will be output of 15%4 in python ?
ANSWER= C)
Explain:- % Modulus - remainder of the division of left operand by the right
5. What will be output of below code in python ? Try to answer before running the code snippet.
ANSWER= C)
Explain:- SyntaxError, there shouldn’t be a space between + and = in +=.
6. What will be output of below code in python ?
L=[1, 0, 3, 0, 'hola', '', [ ]] ,
list(filter(bool, L))
ANSWER= B)
Explain:- Returns a new list containing only those elements of the list L which do not amount to zero.
7. Which of the following is not a core data type in Python programming?
ANSWER= D)
Explain:- Class is a user-defined data type.
8. What is the maximum possible length of an identifier in Python?
ANSWER= D)
Explain:- Identifiers can be of any length..
10. What will be the output of the following code snippet in python?
x = [[0], [1]]
print((' '.join(list(map(str, x))),))
ANSWER= D)
Explain:- (element,) is not the same as element. It is a tuple with one item.
© Copyright 2022, crackdatascienceinterview.in. All rights reserved.