Logo

Python Questions Set 181:

Quiz Mode

>>> import os
>>> os.getcwd()

1
2
3
4

Solution:

What does ORM stand for?

1
2
3
4

Solution:

 

What is the output of the following code?

def foo():
   return total + 1
total = 0
print(foo())

1
2
3
4

Solution:

Which of the following is the execution model for a GUI-based application?

1
2
3
4

Solution:

 

What are the values of the following Python expressions?

2**(3**2)
(2**3)**2
2**3**2

1
2
3
4

Solution:

 Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation? 

1
2

Solution:

Which of the following is used to take an undefined number of arguments in a function?

1
2
3
4

Solution:

 In Python, for and while loop can have optional else statement? 

1
2
3
4

Solution:

Find the output of the following:

a=[1,10,20,30,45,25,50,75,100,125,150]
b=filter(lambda a:True if a>=50 else False, a)
c=filter(lambda a:a%25==0, a)
print(list(c))
print(list(b))

1
2
3
4

Solution:

Observe the code given below:

l = []

i = 0

while(i<10):

     if(i%2==0):

          l.append(i**2)

     i+=1

Which of the following lines of code achieves the same result?

1
2
3
4

Solution: