Blooming bud Public School
Half Yearly Examination
Sub-Informatics Practices Class-XI
Time: 3hr. MM:80
This question paper divided into 5 Section
Section A, consists 10 question each question carry 2 marks.
Section B consists 6 question.
Section C consists 4 Question each question carry 3 marks.
Section D consists 4 Question each question carry 5 marks.
Section E consists 2 Question each question carry 6 marks.
Section A (9x2=18)
Answer the following question in 20 words. (Do any 9)
Q.1.What is the role of the `for` loop in Python?
Q.2.Explain how a `while` loop operates differently from a `for` loop.
Q.3.Write a Python statement to add an element to the end of a list.
Q.4.Describe the function of the `index()` method in lists.
Q.5 How does the `replace()` method work with strings?
Q.6.What does the `pop()` method do when used on a list? Provide an example.
Q.7.Explain the purpose of the `insert()` method in a list.
Q.8.What is the function of the `del()` method in a dictionary?
Q.9.Define the `break` statement and give an example of its use
Q.10.How do you handle errors using exceptions in Python?
Section B (Do any 6)
Q.11. Write a `for` loop to print numbers from 10 to 20. (3)
Q.12.Write a `while` loop to print numbers from 10 to 1. (3 marks) (3)
Q.13.What will the following code output? (3)
lst = [5, 10, 15]
lst.remove(10)
print(lst)
Q.14.Write a program that computes the factorial of a number (3)
Q.15.Given the list `['apple', 'banana', 'cherry']`, use the `index()` method to find the position of
'cherry'. (3)
Q.16.Write a Python function that checks if a given number is even or odd. (3)
Q.17.Describe how the `else` part of an `if-else` statement is executed. (3)
Section ‘C’: Error Identification
Q.18. Identify the correct the error in the following code which is intended to reverse a list: (3)
Ist=[1,2,3,4,5]
for i in range(len(Ist)):
Ist[-1]=Ist[i]
print(Ist)
Q.19. The following code is supposed to find the sum of all even numbers in a list but it contain an
error. Identify and correct the error. (3)
Number=[0,1,2,3,4,5,6]
Total=0
for num in numbers:
if num%2=0:
total=total+sum
print(“Total:”, total)9—8-87----------87777777
Q.20. The following code snippet is meant to all occurrences of a specific element from list. Find and
correct the error: (3)
Ist=[1,2,3,2]
for i in Ist:
if I==2:
Ist.remove(i)
Print(Ist)
Q.21. What is wrong with the following code snippet, and how would you fix it (3)
for i in range(5):
print(i)
if i == 3:
break
print(i)
Section ‘D’ Programming Question (5x4=20)
Q.22.Write a program that generates a list of squares of numbers from 1 to 10.
Q.23.Write a program to store student and their marks until user wants after create list?
Q.24.Write a program to count the number of occurrences of each vowel in a given string.
Q.25.Implement a `while` loop to generate and print the first 10 Fibonacci numbers.
Section ‘E’ (6x2=12)
Q.26.Compare and contrast the list methods append (), insert(), and extend(). Provide code examples
for each method to illustrate their differences.
Q.27.What is difference between while and for Provide code examples of each loop.