Logo

Python Questions Set 99:

Quiz Mode

 

What will be the output of the following Python statement

>>>"abcd"[2:]

1
2
3
4

Solution:

 

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

print('1@ a'.isprintable())

1
2

Solution:

What is the output of the following Python code?

print('cd'.partition('cd'))

1
2
3
4

Solution:

  A class in which one or more methods are only implemented to raise an exception is called an abstract class. 

1
2

Solution:

 The if...elif...else executes only one block of code among several blocks. 


1
2
3
4

Solution:

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


for i in ''.join(reversed(list('abcd'))):

    print (i)

1
2
3
4

Solution:

What will be the output of the following Python code?

a = (2, 3, 4)
print(sum(a, 3))

1
2
3
4

Solution:

 Which of the following functions can help us to find the version of python that we are currently working on? 

1
2
3
4

Solution:

Methods of a class that provide access to private members of the class are called getters and setters.

1
2
3
4

Solution:

  Which is the most appropriate definition for recursion? 

1
2
3
4

Solution: