A. True or False
1. The list() is used to create an empty list.
2. The range() is used for creating a list with elements from 0 to 5.
3. A list can be created without using a constructor.
4. The elements of a list are not identifi ed by their positions.
5. The negative index accesses elements from the start of a list.
6. List1[-1] accesses the fi rst element of a list.
7. L1[2:5] returns all the elements stored between the index 2 and the one less than the end index, i.e. 5-1= 4.
8. It is possible to access the elements of a list only in sequence.
9. The len() returns a number of elements in a list.
10. The sum() returns the sum of all the elements in a list.
11. It is impossible to shuffl e elements randomly in a list.
12. The concatenation operator ‘+’ is used to join two lists.
13. The multiplication operator * is used to replicate the elements in a list.
14. The del operator is used to remove a specifi c element from a list.
15. Odd elements of a list can be displayed using list comprehension.
16. One can insert an element at a given index.
17. The pop(1) removes an element from a list which is at index 1.
18. The pop() removes the last element from a list.
19. A string is a sequence of characters.
20. A programmer can pass a list to a function and perform various operations.
Leave a Reply