1
CHAPTER: LIST IN PYTHON
ASSIGNMENT SET – 1
Time: 30 min M.M. – 20
Q1. What do you mean by List in Python? [1]
Q2. Write the output of the following code: [1]
>>> A = [ ]
>>> A
>>> print(A)
Q3. What do you mean by Nested list? Give example [1]
Q4. Which method is used to create an empty List? [1]
Q5. Negative indexing start from right side of the List(T/F) [1]
Q6. Write the code to convert the following string into List. [1]
“csiplearninghub”
Q7. Write a program to accept 10 numbers from the user and [2]
add even numbers in a list named “evenlist” and odd
numbers in a list named “oddlist”
Q8. Write a function evensum(list) in python that takes list of 10 [2]
numbers as argument and display the sum of all even
numbers in the list.
Q9. What is the difference between slicing and indexing of list? [2]
2
Q10. Write the output of the following code: [2]
L = [[1,2],[3,4],[5,6]]
print(L[0][0])
print(L[-1])
Q11. Write the output of the following code: [2]
[1,3,7,9] < [3,5,4]
[‘A’,’b’,’c’] > [‘z’]
Q12. Write the output of the following code: [4]
S = “csiplearninghub”
L = list(S)
1. print(L[-1:-5])
2. print(L[::-1])
3. print(L[1:8:2])
4. print(L[2:5])

CBSE Python List Assignment

  • 1.
    1 CHAPTER: LIST INPYTHON ASSIGNMENT SET – 1 Time: 30 min M.M. – 20 Q1. What do you mean by List in Python? [1] Q2. Write the output of the following code: [1] >>> A = [ ] >>> A >>> print(A) Q3. What do you mean by Nested list? Give example [1] Q4. Which method is used to create an empty List? [1] Q5. Negative indexing start from right side of the List(T/F) [1] Q6. Write the code to convert the following string into List. [1] “csiplearninghub” Q7. Write a program to accept 10 numbers from the user and [2] add even numbers in a list named “evenlist” and odd numbers in a list named “oddlist” Q8. Write a function evensum(list) in python that takes list of 10 [2] numbers as argument and display the sum of all even numbers in the list. Q9. What is the difference between slicing and indexing of list? [2]
  • 2.
    2 Q10. Write theoutput of the following code: [2] L = [[1,2],[3,4],[5,6]] print(L[0][0]) print(L[-1]) Q11. Write the output of the following code: [2] [1,3,7,9] < [3,5,4] [‘A’,’b’,’c’] > [‘z’] Q12. Write the output of the following code: [4] S = “csiplearninghub” L = list(S) 1. print(L[-1:-5]) 2. print(L[::-1]) 3. print(L[1:8:2]) 4. print(L[2:5])