Logo

Python Questions Set 177:

Quiz Mode

Which method is used to remove a string element from a list.

1
2
3
4

Solution:

What is the output of the following code?


import math

x = 2436.35

y = math.ceil(x)

print(y)

1
2
3
4

Solution:

What is the expected output of the following code?


x = [2*i for i in range(10**1000)]

1
2
3
4

Solution:

class test:

   def __init__(self):

      print "Hello World"

   def __init__(self):

      print "Bye World"

obj=test()


1
2
3
4

Solution:

Which of the following gives the same output as print('hello "world!"')?

1
2
3
4

Solution:

The output of executing string.ascii_letters can also be achieved by: 

1
2
3
4

Solution:

 

 The special character \B matches the empty string, but only when it is _____________

1
2
3
4

Solution:

Which of the following statements about the if statement is false?

1
2
3
4
5

Solution:

 

What will be the output of the following Python code?

l=[]
def convert(b):
   if(b==0):
       return l
   dig=b%2
   l.append(dig)
   convert(b//2)
convert(6)
l.reverse()
for i in l:
   print(i,end="")

1
2
3
4

Solution:

 Lambda functions cannot be pickled because:
 

1
2
3
4

Solution: