0%
0

Get ready, set, go

Time ended


Quiz on Python List

This is a comprehensive MCQ quiz on Python Lists

1 / 15

1. What will be printed with the following python code ?

print(list(range(3)))

2 / 15

2. A python list can contain values of these types:

3 / 15

3. Which one of the following will always return a list?

4 / 15

4. Which of the following will create an empty list?

5 / 15

5. Assume a list:

letters=['a','b','o','c','p'],

What would be displayed in a Python shell for the given expression?

>>>letters[2:5:2]

6 / 15

6. Given a list L=[10,20,30,40,50,60,70],

what would L[2:-2] return?

7 / 15

7. Given a list L=[10,20,30,40,50,60], what would L[1:4] return?

8 / 15

8. Which of the following can delete an element from a list, if its value is given?

9 / 15

9. Given a list of letters, L=['a','e','o','u'],

select the correct statement to add one more item, 'i' after 'e' in the list.

10 / 15

10. Given a list L=[10,20,30,40,50,60,70],

what would L[-4:-1] return?

11 / 15

11. Which of the following function can add only one element to a list ?

12 / 15

12. A list L has 5 items. Which one of the following statements will return the last element of the list?

13 / 15

13. Which of the following can add multiple elements to a list?

14 / 15

14. If L1=[1,3,5] and L2=[2,4,6] then L1+L2 will yield

15 / 15

15. Given a list L=[10,20,30,40,50,60,70],

what would L[-3:99] return?

Your score is

The average score is 0%

Share this quiz with your friends,

 

LinkedIn Facebook Twitter
0%

Rate the quiz

error: Content is protected !!