Logo

Python Questions Set 32:

Quiz Mode

Which HTTP status code is used for Bad Request in Flask?

1
2
3
4

Solution:

  Both the functions randint and uniform accept ____________ parameters. 

1
2
3
4

Solution:

What is called when a function is defined inside a class? 

1
2
3
4

Solution:

Given the following Python code:

x = complex(1j)

y = complex(2+2j)

print(x + y)

1
2
3
4

Solution:

What is the output of the following code?


x = "456"

y = 456

print((y, x))

1
2
3
4

Solution:

 

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

x=3.3456789
'%f | %e | %g' %(x, x, x)

1
2
3

Solution:

Find the output of the following code.

n = "$$abcdabcgjrgeuabcd$$abcd$$**"

c1 = c2 = 0

c1 = n.count('abc')

c2 = n.count('abcd')

c1 -= c2

print('abc={}, abcd={}'.format(c1, c2))

1
2
3
4

Solution:

  How are keyword arguments specified in the function heading? 

1
2
3
4

Solution:

What will be the output of the following Python code?

>>> a={1,2,3}
>>> b=frozenset([3,4,5])
>>> a-b

1
2
3
4

Solution:

 

What will be the output of the following Python code?

places = ['Bangalore', 'Mumbai', 'Delhi']
<br class="blank" />places1 = places
places2 = places[:]
<br class="blank" />places1[1]="Pune"
places2[2]="Hyderabad"
print(places)

1
2

Solution: