Beruflich Dokumente
Kultur Dokumente
GENERAL INSTRUCTIONS:
1. THE QUESTION PAPER HAS TWO PARTS A AND B.
2. THERE ARE INTERNAL CHOICES BETWEEN EACH SECTION OF THE RESPECTIVE PARTS.
3. DO ANY FOUR QUESTIONS FROM SECTION II PART A
4. DO ANY Two QUESTIONS FROM SECTION I PART B
PART A
SECTION 1
1. How to find the last element of a list in Python? Assume `bikes` is the name of the list ?
a) bikes[0] b) bikes[-1] c) bikes[lpos] d) bikes[:-1]. (1)
2. How many times will it print the statement ?, for i in range(100): print(i) (1)
a) 1 b) 100 c) 0
SECTION II
7. What is the difference between extend() and insert() method of a list ? give an example. (2)
8. else clause is available with if as well as loop construct,can you differentiate the use of else in both.
(2)
9. What is indentation and how is it related to block and body ? (2)
PART B
SECTION I
12. Write a program to implement list replication , comprehension and traversing . (3)
13. How will you convert a string to a list ? Give one example. (3)
14. Give an example of remove() , pop() and del statement of a list. (3)
SECTION II
.
15. Write a python program to generate the following output :- (5)
1
1 2
1 2 3
1 2 34