Your school name
2nd Year Computer Chapter 3 Test2nd Year · Computer · Federal (FBISE)
Q1. Multiple choice questions (Attempt all · 10 × 1 = 10)
- Python’s built-in framework for testing code automatically is:
- Main purpose of the programming paradigm is _______.
- Functional programming supports:
- The try-except block is used for:
- The term “programming paradigm” refers to:
- Which function is used to close a file in Python?
- Watchpoints are used to:
- Which data type is used to avoid duplicate keys?
- In Python list, elements are stored in:
- Inheritance allows creation of:
Q2. Short questions (Attempt any 6 of 8 · 6 × 2 = 12)
- What does the inner loop perform in the matrix transpose example?
- What is the role of the assert statement in a test function?
- What is a binary file?
- What is the importance of Disk I/O?
- What is meant by file handling?
- Define Primary Key.
- What is the purpose of the count() method in tuples?
- What types of objects can be dictionary keys?
Q3. Long questions (Attempt any 2 of 3 · 2 × 4 = 8)
- Write a Python program highlighting the use of functions to simplify a problem.For example, create a program that calculates the average of a list of numbers and by using separate functions to add and without repeating values.
- Create a Python dictionary to store student names as keys and their grades as values.Write a program to add new students, update existing students’ grades, and remove students from the dictionary.
- What is Data Normalization in databases? Describe 1NF, 2NF, and 3NF in detail along with suitable examples,