test python quiz

4

Python Quiz - 001

This quiz is to test your knowledge on Python programming

 

1 / 10

If dict is a dictionary, what will be the output of the following statement?

for i in dict: 
    print i

2 / 10

What is the output of the follow statement?

max(0,min(True,1.0)))

3 / 10

What is the output of the following statement?

l = [1,2,3] 
l.append([4,5]) 
print(l)

4 / 10

Which of the following statements is correct ?

5 / 10

What is the output of the following statement?

l = [1,2,3] 
l.extend([4,5]) 

print(l)

6 / 10

What is the output of the following code snippet?

 

List_1 = [[1,1,1],[2,2,2],[3,3,3]]
List_2 = copy.deepcopy(List_1)
List_1.append([4,4,4])

print(List2)

7 / 10

What is the return value of the function id()?

8 / 10

Which is not a built-in data type in Python?

9 / 10

What is the output of this code snippet?

l=[[1 ,0, 1], [0, 1, 0], [1, 0, 1]] 

print([[row[i] for row in l] for i in range(2)])

10 / 10

What is the output of the following statement?

import copy 
a = [1,2,3] 
b = copy.copy(a) 
a.append(4) 

print(b)