Logo

Python Questions Set 170:

Quiz Mode

 Only problems that are recursively defined can be solved using recursion. 

1
2

Solution:

Output?

a="lack of grammar%r"

b="no sentence structure%r"

print "%s and %s, hence no coherence" %(a,b)

Solution:

By default, what is the starting index from which the range() function generates a sequence of numbers?

1
2
3
4

Solution:

 

What will be the output of the following Python code?

print("abcdef".find("cd") == "cd" in "abcdef")

1
2

Solution:

Deduce the output of the following code:


def test(fun,n):

    return fun(fun(n))

def add(n):

    return n+n

print(test(add,4))

Solution:

Data format in place of XXX


import time

str = '03/07/2019'

dat = time.strptime(str, XXX)


1
2
3
4

Solution:

How can you get a list of all built-in exceptions in Python?

1
2
3
4

Solution:

 ______ is a string literal denoted by triple quotes for providing the specifications of certain program elements. 

1
2
3
4

Solution:

Which Django management command is used to start the Python interactive interpreter?

1
2
3
4

Solution:

Which of the following statements about the else statement is true?

1
2
3
4

Solution: