Logo

Python Questions Set 117:

Quiz Mode

What will be the output of the following Python code snippet?

print(''.isdigit())

1
2

Solution:

What is the output of the following code?

def a():

        pass

print(callable(a))

1
2
3
4

Solution:

Which type of loop has a condition that is always true?

1
2
3
4

Solution:

 Which of the following functions is not defined under the sys module? 

1
2
3
4

Solution:

White box testing is also known as which of the following?

1
2
3
4

Solution:

What will be the output of the following Python expression if X = -122?

print("-%06d" % -122)

1
2
3
4

Solution:

 

What will be the output of the following Python code?

>>> a=(1,2)
>>> b=(3,4)
>>> c=a+b
>>> c

1
2
3
4

Solution:

 

What is the output of the following code?

def foo(x):
   x = ['def', 'abc']
   return id(x)
q = ['abc', 'def']
print(id(q) == foo(q))

1
2

Solution:

 

What will be the output of the following Python code?

def foo(x):
   x = ['def', 'abc']
   return id(x)
q = ['abc', 'def']
print(id(q) == foo(q))

1
2

Solution:

 What is the order of precedence in python?
i) Parentheses
ii) Exponential
iii) Multiplication
iv) Division
v) Addition
vi) Subtraction 

1
2
3
4

Solution: