12TH computer science pt1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

GUARDIAN AND GUIDE ENGLISH MEDIUM SCHOOL

P1- EXAMINATION (2024-25)


CLASS – 12th SUBJECT- COMPUTER SCIENCE MM: 70
TIME: 3 hrs
1. This question paper contains 37 questions.

2. All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one of
the choices in such questions.

3. The paper is divided into 5 Sections: A, B, C, D, and E.

4. All programming questions are to be answered using Python Language only.

5. In case of MCQ, the text of the correct answer should also be written.

Section A

Answer the following questions in one or two sentences.

1. [MCQ] Which of the following is a mutable data type in Python?

(a) List (b) Tuple (c) String (d) Integer

2. Define the term 'algorithm.'

3. What does the function len() do in Python?

4. Name the data type returned by the expression 3.14 + 2.

5. What is the output of 5 ** 2 in Python?

6. Give one example of a logical operator in Python.

7. Define encapsulation in object-oriented programming.

8. [MCQ] Which of the following keywords is used to define a function in Python?

(a) func (b) def (c) define (d) function

9. What is the difference between break and continue statements in Python?

10. [MCQ] Which of the following methods is used to add an item to the end of a list in Python?

(a) add() (b) append() (c) insert() (d) extend()

11. Define recursion with an example.

12. What does IDE stand for in programming?

13. What is the purpose of the pass statement in Python?

14. Explain the difference between local and global variables.

15. [MCQ] Which of these libraries is used for data manipulation in Python?
(a) NumPy (b) Pandas (c) Matplotlib (d) Scipy

16. What is a syntax error?

17. What is the role of an interpreter in Python?

18. Write the output of the following code:

Print ("Hello" + " World")

19. Define list comprehension in Python.

20. [MCQ] Which operator is used for floor division in Python?

(a) / (b) // (c) % (d) **

21. Name two functions used to read input from a user in Python.

Section B

Answer the following questions in brief. (2 Marks each)

22. Explain the difference between == and is operators in Python.

23. Write a Python program to check if a number is even or odd.

24. Describe the difference between list and tuple in Python with examples.

25. Explain the role of comments in Python. How do you write single-line and multi-line comments?

26. Write a program to calculate the area of a circle given its radius.

27. Explain the concept of inheritance with an example.

28. Write a Python code to find the largest number among three numbers provided by the user.

Section C

Answer the following questions in detail. (3 Marks each)

29. Explain the concept of a function in Python and write a sample function to add two numbers.

30. What are dictionaries in Python? Create a dictionary with at least three key-value pairs.

31. Write a Python program that calculates the factorial of a number using recursion.

Section D

Answer the following questions with examples. (4 Marks each)

32. What are lambda functions in Python? Write a lambda function to find the square of a number.

33. Write a Python program to remove duplicates from a list.

34. Explain the role of try, except, and finally blocks in exception handling with an example.

35. Write a Python program to find the sum of all even numbers in a list.
Section E

Answer the following questions in detail. (5 Marks each)

36. Write a Python program to create a class named Rectangle with attributes length and width. Include methods to
calculate area and perimeter. Provide an example of how to create an instance of this class and use its methods.

37. Describe how file handling works in Python. Write a program to read from a text file and count the number of words
in the file.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy