Logo

Python Questions Set 49:

Quiz Mode

Find the output of the following code:


print(eval("10%12"))

Solution:

Find the output of the following code:


s1={1,1,2,2,3,4,4,5,5,5}

s2={2,4,6,8,3}

print(s1|s2)

Solution:

Which class in Django receives a request and returns a response?

1
2
3
4

Solution:

What is Flask Sijax?

1
2
3
4

Solution:

Output of following script:


mat = [[1,2,3], [4,5,6], [7,8,9]]


for i in range(0,2):

    print(mat[i][1])

1
2
3
4

Solution:

Which primary key types does Django support?

1
2
3
4

Solution:

What is the output of the following code?


x="abcd"

y="efgh"

z="ijkl"

print("{0} {2} {1}".format(y,z,x))

1
2
3
4

Solution:

 

What will be the output of the following Python function?


 divmod(10.5,5)

 divmod(2.4,1.2) 

1
2
3
4

Solution:

What will the following code do?

from time import time
a = time()
sum = 0
for i in range(200001):
sum = sum + i
b = time()
print(b - a)

1
2
3
4

Solution:

 

What will be the output of the following Python code?

sentence = 'horses are fast'
regex = re.compile('(?P<animal>\w+) (?P<verb>\w+) (?P<adjective>\w+)')
matched = re.search(regex, sentence)
print(matched.groups())

1
2
3
4

Solution: