0% found this document useful (0 votes)
6 views

Core 1 Sample Paper

Uploaded by

csdeptpragati
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Core 1 Sample Paper

Uploaded by

csdeptpragati
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

CHAPTER-1 : INTRODUCTION TO COMPUTER


FILL IN THE BLANKS (1 MARK)

1. The first generation of computers used ________ for processing. (Answer: Vacuum
tubes)
2. The second generation of computers used ________ for processing. (Answer:
Transistors)
3. The third generation of computers used ________ for processing. (Answer: Integrated
Circuits)
4. The fourth generation of computers used ________ for processing. (Answer:
Microprocessors)
5. The fifth generation of computers is based on ________ and artificial intelligence.
(Answer: Parallel processing)
6. The ________ generation of computers saw the development of personal computers.
(Answer: Fourth)
7. The ________ generation of computers introduced high-level programming
languages like COBOL and FORTRAN. (Answer: Second)
8. The ________ generation of computers was characterized by the use of magnetic
cores for memory. (Answer: Third)
9. The ________ generation of computers used assembly language for programming.
(Answer: Second)
10. The ________ generation of computers is still in development today, focusing on
artificial intelligence and machine learning. (Answer: Fifth)
11. A ________ is a computer designed to process large amounts of data and perform
complex calculations. (Answer: Supercomputer)
12. A ________ is a computer designed for everyday use by individuals. (Answer:
Personal computer)
13. A ________ is a small computer used for portable applications, like smartphones and
tablets. (Answer: Mobile computer)
14. A ________ is a type of computer used by organizations to process large-scale data
and support thousands of users. (Answer: Mainframe)
15. A ________ is designed to handle specific tasks such as controlling machines or
equipment. (Answer: Embedded computer)
16. The central unit that controls and processes data in a computer is called the
________. (Answer: CPU)
17. The ________ is the part of the CPU that performs arithmetic and logic operations.
(Answer: ALU - Arithmetic Logic Unit)
18. The ________ stores data temporarily and holds it for the CPU to process. (Answer:
Memory unit)
19. The ________ is used to store data permanently in a computer. (Answer: Storage
device)
20. The ________ connects the CPU to other hardware components like the memory and
input/output devices. (Answer: Bus)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
1
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

21. The ________ in a computer system manages all the hardware and software.
(Answer: Operating System)
22. The ________ is a visual display device used to present information to the user.
(Answer: Monitor)
23. The ________ allows a computer to communicate with external devices. (Answer: I/O
ports)
24. The ________ provides the power needed to run the entire computer system.
(Answer: Power supply)
25. The ________ memory is the fastest and is located inside the CPU. (Answer: Cache
memory)
26. The ________ memory is used to store data that is actively being used by the CPU.
(Answer: Primary memory)
27. ________ memory is also known as volatile memory, as it loses its data when power
is off. (Answer: RAM)
28. The ________ memory stores data even when the computer is turned off. (Answer:
Secondary memory)
29. The ________ memory stores the system's startup instructions. (Answer: ROM)
30. The ________ is a small, high-speed storage location within the CPU. (Answer:
Register)
31. ________ memory is used for storing large amounts of data, like hard drives or SSDs.
(Answer: Secondary)
32. The memory hierarchy starts from ________ memory and goes down to secondary
storage devices. (Answer: Cache)
33. The ________ memory provides the largest capacity in the computer system.
(Answer: Secondary)
34. The process of moving data from primary memory to secondary memory is called
________. (Answer: Swapping)
35. The ________ is used to hold data temporarily during program execution in RAM.
(Answer: Cache)
36. The ________ memory is non-volatile and used to store firmware. (Answer: ROM)
37. ________ memory is faster than hard disk storage but slower than CPU registers.
(Answer: RAM)
38. ________ is the process of retrieving data from memory. (Answer: Access)
39. ________ is a type of memory used for quickly retrieving frequently used data.
(Answer: Cache memory)
40. ________ memory has slower access times but is used for large-scale storage.
(Answer: Secondary)
41. A ________ device allows users to input data into a computer. (Answer: Input)
42. A ________ device allows users to receive data from a computer. (Answer: Output)
43. A ________ is used to convert typed characters into data that the computer can
understand. (Answer: Keyboard)
44. A ________ is used to point and select objects on a screen. (Answer: Mouse)
45. A ________ is a popular input device used to scan images and text. (Answer:
Scanner)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
2
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

46. A ________ is used to output printed documents. (Answer: Printer)


47. A ________ is used to convert digital signals into sound. (Answer: Speaker)
48. A ________ is used to display visual output from the computer. (Answer: Monitor)
49. A ________ is an input device that captures audio. (Answer: Microphone)
50. A ________ is used to output high-quality graphics and videos. (Answer: Graphics
card)
51. ________ software controls the hardware and provides an interface for other
software. (Answer: System)
52. ________ software allows the user to perform specific tasks like word processing or
accounting. (Answer: Application)
53. ________ software is designed to help maintain, manage, or improve computer
systems. (Answer: Utility)
54. ________ is a type of software that is embedded in hardware devices. (Answer:
Firmware)
55. An example of ________ software is the Windows operating system. (Answer:
System)
56. ________ software helps in preventing and managing computer viruses. (Answer:
Antivirus)
57. The ________ software acts as an interface between hardware and user applications.
(Answer: Operating system)
58. The ________ software includes programs like web browsers, games, and media
players. (Answer: Application)
59. The ________ software ensures that devices like printers or scanners function
properly. (Answer: Driver)
60. ________ is a utility software used to compress and archive files. (Answer: WinRAR)
61. ________ is a type of system software that manages computer hardware and
resources. (Answer: Operating system)
62. ________ software deals with the management of hardware in an embedded system.
(Answer: Firmware)
63. A ________ network is used to connect devices in a small geographical area like a
home or office. (Answer: LAN)
64. A ________ network spans a larger geographical area than a LAN, such as a city.
(Answer: MAN)
65. A ________ network connects devices across a global geographical area. (Answer:
WAN)
66. The ________ is a global network that connects millions of private, public, academic,
and business networks. (Answer: Internet)
67. A ________ device forwards data between two or more networks and manages
network traffic. (Answer: Router)
68. A ________ device amplifies or regenerates signals to extend the range of a network.
(Answer: Repeater)
69. A ________ device connects two networks and filters traffic between them. (Answer:
Bridge)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
3
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

70. A ________ device connects devices within a network and forwards data to the
correct device. (Answer: Switch)
71. A ________ connects different networks and facilitates communication between
them. (Answer: Gateway)
72. A ________ is used to create a wireless network within a specific area, like an office
or home. (Answer: Wireless router)
73. The ________ network is commonly used for connecting devices in a campus or local
area. (Answer: LAN)
74. A ________ is a network device that links devices to the internet or other local
networks. (Answer: Modem)
75. The ________ is a protocol used for sending data over the internet. (Answer: TCP/IP)
76. A ________ is used to establish a virtual private network over the internet. (Answer:
VPN)
77. The ________ is responsible for routing packets of data to their destinations on the
internet. (Answer: Router)
78. The ________ is a system of interconnected computers and devices that share
resources and information. (Answer: Network)
79. A ________ is a network device used to extend the distance between two network
segments. (Answer: Repeater)
80. ________ devices include computers, printers, servers, and routers. (Answer:
Network)
81. ________ is the most common protocol used for transferring web pages across the
internet. (Answer: HTTP)
82. The ________ provides the logical addressing required for devices on a network.
(Answer: IP address)
83. A ________ is a software that provides services and resources to other computers on
a network. (Answer: Server)
84. ________ is a type of network used for long-distance communication and spanning
different countries. (Answer: WAN)
85. The ________ allows data transfer between different types of networks. (Answer:
Gateway)
86. The ________ helps in maintaining the security of data transfers across a network.
(Answer: Firewall)
87. The ________ network is typically used for connecting devices within an office or
campus. (Answer: LAN)
88. A ________ ensures the successful transmission of data from one computer to
another. (Answer: Protocol)
89. The ________ network device is used to connect multiple devices in a network and
manage data traffic. (Answer: Switch)
90. A ________ is used to ensure that data can travel through a network even if one path
is down. (Answer: Router)
91. The ________ of a computer system include the hardware, software, and data.
(Answer: Components)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
4
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

92. ________ memory is used for quick retrieval of frequently accessed data. (Answer:
Cache)
93. The ________ is responsible for controlling the operations of a computer. (Answer:
CPU)
94. The ________ is used to store data when the computer is turned off. (Answer: Hard
disk)
95. The ________ software allows the user to interact with the computer hardware.
(Answer: System)
96. A ________ connects computers within a limited area, such as a building. (Answer:
LAN)
97. ________ devices allow a user to input commands and data into a computer system.
(Answer: Input)
98. A ________ device is used to display the output from a computer to the user.
(Answer: Output)
99. The ________ is the fastest type of memory used by a computer. (Answer: Cache)
100. ________ are network devices that manage and monitor data flow in a network.
(Answer: Routers)

SHORT ANSWER TYPE[1.5 MARKS/2 MARKS]

1. What was the main feature of the first generation of computers?


○ Answer: The first generation of computers used vacuum tubes for processing
and were large, slow, and consumed a lot of electricity.
2. Explain the role of transistors in the second generation of computers.
○ Answer: Transistors replaced vacuum tubes, making computers smaller, faster,
more reliable, and less power-consuming.
3. What was the key advancement in the third generation of computers?
○ Answer: The third generation of computers used integrated circuits (ICs),
leading to smaller size, higher efficiency, and better performance.
4. How did the fourth generation of computers differ from earlier generations?
○ Answer: The fourth generation introduced microprocessors, making computers
even smaller, faster, and affordable, leading to personal computers.
5. What is the main feature of the fifth generation of computers?
○ Answer: The fifth generation of computers is based on artificial intelligence (AI)
and parallel processing, focusing on advanced computing and smart systems.
6. What is a supercomputer?
○ Answer: A supercomputer is a high-performance machine used for complex
calculations, simulations, and tasks like weather forecasting or scientific
research.
7. Describe the function of a personal computer.
○ Answer: A personal computer is designed for individual use, typically for tasks
such as word processing, internet browsing, gaming, and media consumption.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
5
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

8. What is an embedded computer?


○ Answer: An embedded computer is a specialized computer integrated into a
device to control its operations, such as in cars, washing machines, and medical
devices.
9. What is a mainframe computer used for?
○ Answer: A mainframe computer is used by large organizations to process bulk
data and support multiple users simultaneously for tasks like transaction
processing.
10. How does a mobile computer differ from a desktop computer?
Answer: Mobile computers, such as laptops and smartphones, are portable and have
lower power consumption, whereas desktop computers are stationary and often more
powerful.
11. Draw and explain the block diagram of a computer system.
○ Answer: The block diagram includes the Central Processing Unit (CPU), memory
unit, input devices, output devices, and storage devices. The CPU consists of the
Control Unit (CU) and Arithmetic Logic Unit (ALU).
12. What is the function of the CPU in a computer system?
○ Answer: The CPU performs all the calculations, logical operations, and manages
the flow of data between the system's components.
13. Explain the role of the memory unit in a computer system.
○ Answer: The memory unit stores data and instructions that are being processed
by the CPU, providing quick access to information during computation.
14. What is the purpose of storage devices in a computer system?
○ Answer: Storage devices, such as hard drives and SSDs, store data and
programs permanently or temporarily for retrieval when needed.
15. What is a bus in a computer system?
○ Answer: A bus is a communication pathway that allows data to be transferred
between the CPU, memory, and other peripheral devices.
16. What is the difference between primary and secondary memory?
○ Answer: Primary memory (RAM) is volatile and used for temporary storage of
data actively in use. Secondary memory (e.g., hard drives) provides permanent
data storage.
17. Define cache memory and its role in computer performance.
○ Answer: Cache memory is a small, high-speed memory located close to the CPU
that stores frequently accessed data to reduce processing time and increase
performance.
18. What are CPU registers, and what is their function?
○ Answer: CPU registers are small, fast storage locations within the CPU used to
hold data, instructions, and addresses temporarily during processing.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
6
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

19. Explain the concept of memory hierarchy.

○ Answer: Memory hierarchy refers to the arrangement of different types of


memory (like cache, RAM, and hard drives) in a computer system, where faster,
smaller memory types are closer to the CPU and slower, larger ones are further
away.

20. What is the purpose of ROM in a computer system?


○ Answer: ROM (Read-Only Memory) is non-volatile memory that stores the
firmware or permanent instructions necessary to boot up the computer.
21. What is the difference between random access memory (RAM) and read-only
memory (ROM)?
○ Answer: RAM is volatile and used for temporary data storage, whereas ROM is
non-volatile and stores permanent data, such as boot instructions.
22. What are the various methods of accessing data in memory?
○ Answer: The various access methods include random access (RAM), sequential
access (tape drives), and direct access (hard drives, SSDs).
23. What is the role of virtual memory?
○ Answer: Virtual memory allows the system to use disk storage as an extension of
RAM when the physical RAM is full, enabling larger programs to run.
24. Why is secondary memory important in a computer system?
○ Answer: Secondary memory provides long-term storage for data, programs, and
files, ensuring that information is retained even when the computer is powered
off.
25. What are input devices? Give two examples.
○ Answer: Input devices allow data to be entered into a computer. Examples
include the keyboard and mouse.
26. What is the function of an output device?
○ Answer: Output devices display or project data that has been processed by the
computer. Examples include monitors and printers.
27. What is the difference between a scanner and a camera as input devices?
○ Answer: A scanner digitizes images or documents by converting them into
digital format, while a camera captures still or moving images and videos.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
7
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

28. How does a printer work as an output device?


○ Answer: A printer converts digital text and images into physical copies on paper
by using ink or toner.
29. What is the function of a speaker in a computer system?
○ Answer: A speaker converts digital audio signals into sound, allowing users to
hear music, notifications, or voice commands.
30. Explain the purpose of a monitor in a computer system.
○ Answer: A monitor is an output device that displays visual information, such as
text, images, and videos, from the computer to the user.
31. What is system software, and give an example.
○ Answer: System software manages hardware and provides an interface for
application software. An example is the operating system, such as Windows or
Linux.
32. Differentiate between system software and application software.
○ Answer: System software controls and manages hardware, while application
software is used by users to perform specific tasks, such as word processing or
gaming.
33. What is utility software, and give an example.
○ Answer: Utility software helps maintain and optimize computer performance,
such as antivirus software or disk cleanup tools.
34. Define firmware and its role in a computer system.
○ Answer: Firmware is a specialized type of software embedded in hardware
devices that provides low-level control, such as the BIOS in a computer.
35. Explain the role of device drivers in a computer system.
○ Answer: Device drivers are software that enables the operating system to
communicate with and control hardware devices like printers, graphics cards,
and scanners.
36. What are application software and its common types?
○ Answer: Application software helps users perform tasks, such as word
processors, web browsers, and media players.
37. What is the importance of computer networking?
○ Answer: Computer networking allows devices to communicate, share resources,
and exchange data over various distances, enabling collaboration, internet
access, and resource sharing.
38. Explain the difference between LAN, MAN, and WAN.
○ Answer: LAN (Local Area Network) covers a small area like a home or office,
MAN (Metropolitan Area Network) spans a city or town, and WAN (Wide Area
Network) connects devices over large geographical areas, such as across
countries.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
8
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

39. What is the function of a router in a network?

○ Answer: A router forwards data packets between networks, ensuring the data
reaches its correct destination by choosing the best path.
40. What is the role of a switch in a network?

○ Answer: A switch connects devices within a network and forwards data only to
the specific device for which it is intended, improving network efficiency.

CHAPTER-2 (PROGRAMMING DEVELOPMENT)

FILL IN THE BLANKS (1 MARKS / 2 MARKS)

1. The process of understanding and breaking down a problem into smaller, manageable
parts is called ________. (Answer: Problem analysis)
2. ________ is the step where the solution to a problem is designed in a step-by-step
manner. (Answer: Program design)
3. The phase of software development where actual coding is done is called ________.
(Answer: Program development)
4. A well-organized plan to solve a problem through the use of a program is known as a
________. (Answer: Program)
5. ________ refers to the process of writing and maintaining the source code of a
program. (Answer: Programming)
6. An ________ is a set of well-defined instructions to solve a problem in a finite amount
of time. (Answer: Algorithm)
7. ________ is a tool used to represent an algorithm in human-readable form with a mix
of natural language and programming syntax. (Answer: Pseudo code)
8. ________ structures are used in an algorithm to determine the flow of control, such
as sequence, selection, and iteration. (Answer: Control)
9. An algorithm is said to be ________ if it produces the correct output for all possible
inputs. (Answer: Correct)
10. ________ is used to define the steps of an algorithm in a more structured way,
resembling a programming language. (Answer: Pseudo code)
11. A ________ is a diagrammatic representation of an algorithm that uses symbols to
represent operations. (Answer: Flowchart)
12. The ________ in a flowchart represents the start or end of a process. (Answer: Oval)
13. A ________ symbol in a flowchart is used to show a process or operation. (Answer:
Rectangle)
14. The ________ symbol in a flowchart is used to represent decision-making, often with
yes/no branches. (Answer: Diamond)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
9
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

15. A ________ symbol in a flowchart is used to represent input or output operations.


(Answer: Parallelogram)
16. A flowchart helps in visualizing the ________ of an algorithm. (Answer: Flow of
control)
17. Flowcharts are useful in ________ programming as they help in understanding the
process before coding. (Answer: Structured)
18. A ________ flowchart is created from top to bottom, showing the flow from general
to specific. (Answer: Top-down)
19. ________ symbols are standardized shapes used in flowcharts to represent different
types of actions. (Answer: Flowchart)
20. The purpose of preparing a flowchart is to make the process of problem-solving
________. (Answer: Clear)
21. ________ programming is a programming paradigm that focuses on dividing a
program into functions or procedures. (Answer: Structured)
22. In ________ programming, objects are the basic units of data and methods that
operate on data. (Answer: Object-oriented)
23. The ________ approach to program design starts with a broad overview of the
system and breaks it down into smaller sub-components. (Answer: Top-down)
24. The ________ approach in program design begins by focusing on small components
and later integrates them into the whole system. (Answer: Bottom-up)
25. The primary focus of ________ programming is reusability and organization of code
into classes and objects. (Answer: Object-oriented)
26. ________ programming emphasizes writing procedures or functions that operate on
data. (Answer: Structured)
27. A good program should have qualities like ________, efficiency, and maintainability.
(Answer: Correctness)
28. ________ is the practice of writing clear, concise, and well-documented code.
(Answer: Good programming practice)
29. A program is considered ________ if it solves the intended problem with minimal
resources. (Answer: Efficient)
30. ________ is the process of breaking down the program into smaller, manageable
parts. (Answer: Decomposition)
31. ________ languages are close to machine code and are harder for humans to
understand. (Answer: Low-level)
32. ________ languages are designed to be easy for humans to read and write, using
symbols and syntax closer to natural language. (Answer: High-level)
33. The first generation of programming languages used ________ to communicate
directly with the hardware. (Answer: Machine code)
34. The second generation of programming languages is represented by ________, which
uses mnemonics to represent machine-level instructions. (Answer: Assembly language)
35. The third generation of programming languages introduced high-level languages like
________. (Answer: COBOL, FORTRAN)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
10
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

36. The fourth generation of programming languages includes languages that focus on
database management systems and high-level abstraction, such as ________.
(Answer: SQL)
37. ________ languages are more abstract and user-friendly compared to low-level
languages. (Answer: High-level)
38. A ________ language is easier to understand and use, typically providing a higher
level of abstraction. (Answer: High-level)
39. The first generation of programming languages was built using ________. (Answer:
Binary machine code)
40. ________ languages are difficult for humans to use and are mainly
machine-oriented. (Answer: Low-level)
41. An ________ is a program that translates a high-level language into machine code.
(Answer: Compiler)
42. An ________ translates code line by line, executing instructions one at a time.
(Answer: Interpreter)
43. A ________ translates assembly language into machine code. (Answer: Assembler)
44. A ________ links object code files together to create an executable program.
(Answer: Linker)
45. A ________ is a program that loads an executable program into memory for
execution. (Answer: Loader)
46. ________ is the process of converting a program's source code into executable code.
(Answer: Compilation)
47. A ________ ensures that all external references in the code are resolved during
compilation. (Answer: Linker)
48. The ________ tool helps in editing source code before compilation. (Answer: Editor)
49. ________ is a software application that combines editing, compiling, and debugging
in one environment. (Answer: Integrated Development Environment - IDE)
50. The ________ manages the interaction between the operating system and the
application code. (Answer: Loader)
51. A ________ error occurs when the syntax of the code does not conform to the
language rules. (Answer: Syntax)
52. A ________ error arises when the program produces an incorrect result due to
incorrect logic. (Answer: Logical)
53. A ________ error occurs when a program violates the rules of the programming
language's semantics. (Answer: Semantic)
54. ________ errors happen during the compilation phase when the code cannot be
translated into machine language. (Answer: Compile-time)
55. ________ errors occur while the program is running, causing it to crash or behave
unexpectedly. (Answer: Runtime)
56. ________ errors occur when the program cannot locate required external
components or libraries. (Answer: Link-time)
57. ________ errors are related to issues with the environment in which the program
runs, like memory allocation. (Answer: Environmental)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
11
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

58. ________ errors occur when the program cannot correctly handle input from the user
or other external sources. (Answer: Input/output)
59. ________ errors prevent the program from compiling due to improper syntax or
missing components. (Answer: Syntax)
60. ________ errors cause a program to work incorrectly but still allow it to run. (Answer:
Logical)
61. ________ is the process of finding and fixing bugs in a program. (Answer: Debugging)
62. ________ is the practice of testing a program to ensure it works correctly and meets
its requirements. (Answer: Software testing)
63. A ________ test verifies that the program performs the intended function under
normal conditions. (Answer: Functional)
64. ________ testing focuses on finding errors in the code by running it with various
inputs. (Answer: Unit)
65. ________ testing ensures that the program behaves as expected in different
environments and conditions. (Answer: Regression)
66. The process of executing a program in a controlled environment to identify faults is
called ________. (Answer: Debugging)
67. ________ testing checks if the program functions correctly across different platforms
and systems. (Answer: Compatibility)
68. ________ errors are easier to find because they prevent the program from compiling.
(Answer: Syntax)
69. ________ errors are difficult to trace because they may occur only during certain
conditions or input. (Answer: Logical)
70. ________ testing involves checking the overall integration and communication
between multiple components or modules of the program. (Answer: Integration)
71. A ________ is a tool used to write, edit, and debug the source code. (Answer: Text
editor)
72. A ________ is a higher-level approach to coding that focuses on solving a problem in
a specific way. (Answer: Paradigm)
73. The ________ model involves testing parts of a program individually before
combining them. (Answer: Top-down)
74. A ________ is a software development process in which the program is built
incrementally, focusing on smaller units first. (Answer: Bottom-up design)
75. ________ is the ability to modify a program to meet changing requirements without
major redesign. (Answer: Flexibility)
76. The ________ phase of program development is responsible for creating
documentation, testing, and deploying the program. (Answer: Maintenance)
77. A program that does not handle errors gracefully is said to have poor ________.
(Answer: Robustness)
78. The ________ model is used when a system or program is created with minimal
changes. (Answer: Waterfall)
79. A ________ software system makes it easier to scale and extend functionalities.
(Answer: Modular)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
12
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

80. ________ is when a program runs without errors but produces incorrect output due
to flawed logic. (Answer: Logical error)

SHORT TYPE QUESTION[1.5 MARKS / 2 MARKS]

1. What is Program Development?


Answer: Program development is the process of designing, writing, testing, and
maintaining a program from the initial problem analysis to the final product.
2. What are the stages of Program Development?
Answer: The stages are:
1. Problem analysis
2. Program design
3. Program development
4. Testing
5. Maintenance
3. What is Problem Analysis in Program Development?
Answer: Problem analysis involves understanding the problem, identifying
requirements, and outlining what the program needs to do before starting the design
and development.
4. What is Program Design?
Answer: Program design is the process of planning the structure, components, and
logic of the program to solve the identified problem.
5. What is Program Development?
Answer: Program development refers to the actual coding or implementation phase
where the program is written according to the design.
6. What is an Algorithm?
Answer: An algorithm is a finite sequence of well-defined, step-by-step instructions to
solve a problem or perform a task.
7. What is Pseudocode?
Answer: Pseudocode is a method of writing algorithms in a readable format using
simple language without worrying about syntax.
8. What are Control Structures in programming?
Answer: Control structures are constructs that define the flow of control in a program.
The main types are:
1. Sequence
2. Selection (e.g., if-else)
3. Iteration (e.g., for, while loops)
9. What is the significance of control structures?
Answer: Control structures help in directing the flow of execution and decision-making
in a program, allowing for structured and logical operations.
10. What is a Flowchart?
Answer: A flowchart is a diagrammatic representation of an algorithm that uses
various symbols to represent different steps and control flow.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
13
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

11. What are the symbols used in a Flowchart?


Answer: Common symbols include:
■ Oval: Start/End
■ Rectangle: Process
■ Parallelogram: Input/Output
■ Diamond: Decision
■ Arrows: Flow of control

12. How do you prepare a flowchart for an algorithm?


Answer: Start by identifying the key steps, use appropriate symbols to represent each
step, and connect them with arrows to show the flow of logic.
13. What is Structured Programming?
Answer: Structured programming is a programming paradigm that emphasizes
dividing programs into smaller, manageable functions using control structures.
14. What is Object-Oriented Programming (OOP)?
Answer: OOP is a programming paradigm that organizes code into objects, which
contain both data and methods. It focuses on principles like encapsulation, inheritance,
and polymorphism.
15. What is the Top-Down Design Approach?
Answer: Top-down design is a method where the system is broken down into smaller
parts, starting with a high-level overview and refining it into more specific details.
16. What is the Bottom-Up Design Approach?
Answer: Bottom-up design starts with the development of low-level modules and then
combines them to form a larger system.
17. What are the Characteristics of a Good Program?
Answer: A good program should be:
1. Correct
2. Efficient
3. Readable
4. Maintainable
5. Portable

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
14
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

18. What are Low-Level Languages?


Answer: Low-level languages, such as assembly language, are closely related to
machine code and provide little abstraction from the hardware.
19. What are High-Level Languages?
Answer: High-level languages, such as C, Python, and Java, are abstracted from the
hardware and are closer to human language, making them easier to write and
understand.
20. What are the Different Generations of Programming Languages?
Answer: The generations are:
1. First Generation: Machine language
2. Second Generation: Assembly language
3. Third Generation: High-level languages (e.g., C, Java)
4. Fourth Generation: Declarative languages (e.g., SQL)
5. Fifth Generation: Artificial Intelligence languages
21. What is the Concept of a Translator in programming?
Answer: A translator is a program that converts high-level code into machine-readable
code. Examples include assemblers, compilers, and interpreters.
22. What is an Assembler?
Answer: An assembler is a program that translates assembly language code into
machine code.
23. What is a Compiler?
Answer: A compiler translates high-level programming code into machine code in a
single batch, producing an executable file.
24. What is an Interpreter?
Answer: An interpreter translates and executes high-level programming code
line-by-line during execution, without creating an intermediate machine code file.
25. What is the Role of a Linker?
Answer: A linker combines object files into a single executable program by resolving
references between them.
26. What is the Role of a Loader?
Answer: A loader is responsible for loading an executable program into memory so
that it can be run.
27. What is an Editor in programming?
Answer: An editor is a tool used to write and modify source code in a programming
language.
28. What is an Integrated Development Environment (IDE)?
Answer: An IDE is a software application that combines tools like code editors,
compilers, debuggers, and other utilities to streamline software development.
29. What are Syntax Errors?
Answer: Syntax errors occur when the code violates the grammatical rules of the
programming language, such as missing punctuation or incorrect keyword usage.
30. What are Semantic Errors?
Answer: Semantic errors occur when the program runs but produces incorrect results
due to logical mistakes.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
15
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

31. What are Logical Errors?


Answer: Logical errors are mistakes in the program's logic that lead to unintended
behavior or incorrect results.
32. What are Compile-Time Errors?
Answer: Compile-time errors occur during the compilation phase, such as syntax or
type mismatch errors.
33. What are Run-Time Errors?
Answer: Run-time errors occur when the program is running, often due to invalid input
or unhandled conditions.
34. What are Link-Time Errors?
Answer: Link-time errors occur during the linking phase, such as missing libraries or
unresolved symbols.
35. What are Environmental Errors?
Answer: Environmental errors occur due to system-related issues, such as insufficient
memory or missing configuration files.
36. What are Input/Output Errors?
Answer: Input/output errors occur when there are issues with reading from or writing
to files or devices.
37. What is Debugging?
Answer: Debugging is the process of identifying and fixing errors or bugs in a program.
38. What is Testing in Programming?
Answer: Testing involves evaluating the program by running it under various conditions
to ensure it works correctly and meets the requirements.
39. What is the Difference Between Compile-Time and Run-Time Errors?
Answer: Compile-time errors are detected during the compilation of the program, while
run-time errors occur when the program is being executed.
40. How are Syntax and Semantic Errors Different?
Answer: Syntax errors are caused by incorrect language structure, while semantic
errors are logical mistakes that cause incorrect results.
41. What is the Significance of Testing in Program Development?
Answer: Testing ensures that the program works as expected, helping to identify and
correct errors early in the development process.
42. What is Unit Testing?
Answer: Unit testing involves testing individual units or components of the program in
isolation to ensure they function correctly.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
16
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

43. What is Integration Testing?


Answer: Integration testing involves testing the interaction between different modules
or components to ensure they work together as expected.
44. What is System Testing?
Answer: System testing is the process of testing the entire system as a whole to ensure
it meets the requirements and functions as intended.
45. What is Regression Testing?
Answer: Regression testing involves testing the program after changes or updates to
ensure that existing functionality has not been broken.
46. What is Black-box Testing?
Answer: Black-box testing focuses on testing the functionality of the program without
knowledge of its internal structure or code.
47. What is White-box Testing?
Answer: White-box testing involves testing the internal logic and structure of the
program to ensure it functions correctly.
48. What is the Difference Between Syntax and Runtime Errors?
Answer: Syntax errors occur during compilation due to incorrect code structure, while
runtime errors occur when the program is executed and typically involve invalid
operations.
49. What is Structured Program Design?
Answer: Structured program design involves creating a program using logical
structures like sequences, decisions, and loops to ensure clarity and maintainability.
50. What is Object-Oriented Program Design?
Answer: Object-oriented program design involves creating software by organizing it
into objects that represent real-world entities and behaviors.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
17
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

51. What is Top-Down Design?


Answer: Top-down design starts by breaking down the problem into major
components, which are then refined into smaller, more detailed subcomponents.
52. What is Bottom-Up Design?
Answer: Bottom-up design starts by focusing on individual components or modules
and then integrates them into a complete system.
53. What is Modularity in Program Design?
Answer: Modularity refers to breaking down a program into smaller, independent
modules, making it easier to manage, understand, and maintain.
54. What is Cohesion in Program Design?
Answer: Cohesion refers to how closely related and focused the responsibilities of a
single module are. High cohesion means that a module is highly focused on a single
task.
55. What is Coupling in Program Design?
Answer: Coupling refers to the degree of dependency between modules. Low coupling
(independence) is desirable for easier maintenance and flexibility.
56. What is the Purpose of Program Documentation?
Answer: Documentation helps others (and the programmer themselves) understand the
structure, function, and usage of the code, facilitating maintenance and collaboration.
57. What is Algorithm Efficiency?
Answer: Algorithm efficiency refers to the resources (time, space) required by an
algorithm to solve a problem, typically measured in terms of time and space
complexity.

58. What is Time Complexity?

Answer: Time complexity refers to the amount of time an algorithm takes to run as a
function of the size of the input.

59. What is Space Complexity?


Answer: Space complexity refers to the amount of memory an algorithm uses relative
to the size of the input.
60. What is the Purpose of a Flowchart in Program Design?

Answer: Flowcharts help visually represent the logic of an algorithm, making it easier
to design, understand, and communicate.

61. What is the Difference Between Structured and Object-Oriented Design?


○ Answer: Structured design emphasizes dividing the program into functions or
procedures, while OOP focuses on organizing the code into objects and classes.
62. What is the Purpose of the Compiler?
○ Answer: A compiler translates the entire source code into machine code before
execution, creating an executable program.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
18
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

63. What is the Function of a Loader?


○ Answer: A loader loads an executable program into memory and prepares it for
execution.
64. What is Debugging?
Answer: Debugging is the process of finding and fixing bugs or errors in the program.
65. What is an IDE?
○ Answer: An IDE is an Integrated Development Environment, which combines
several development tools such as editors, compilers, and debuggers into a
single application.
66. What is the Role of an Assembler?
Answer: An assembler translates assembly language code into machine-readable code.
67. What is the Role of an Interpreter?
○ Answer: An interpreter directly executes the instructions written in a
programming language, translating them line-by-line.
68. What is a Linker Used For?
○ Answer: A linker combines object files into a single executable file.
69. What is the Difference Between High-Level and Low-Level Languages?
○ Answer: High-level languages are more abstract and easier to use, while
low-level languages provide more control over hardware but are harder to use.
70. What is the Purpose of Testing?
○ Answer: The purpose of testing is to ensure that the program behaves as
expected under various conditions.
71. What is the Role of a Flowchart in Debugging?
○ Answer: Flowcharts help visualize the program's flow, aiding in identifying
logical errors and inconsistencies during debugging.
72. **What is the Difference Between Compile-Time and Link-Time Errors?**

Answer: Compile-time errors are detected during code compilation, while link-time
errors occur when object files are being linked to create the executable.

73. What is the Purpose of Program Documentation?


○ Answer: Documentation helps developers understand the functionality, usage,
and logic of the program, promoting easy maintenance and collaboration.
74. What is the Role of Control Structures?
○ Answer: Control structures determine the flow of execution in a program and
allow for decision-making and repetition.
75. What is Modularization?
○ Answer: Modularization refers to breaking a program into smaller, more
manageable sections or modules to enhance readability and reusability.
76. What is Encapsulation?
○ Answer: Encapsulation is the OOP principle that restricts access to certain
details of an object, exposing only necessary parts.
77. What is Polymorphism?

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
19
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

○ Answer: Polymorphism allows objects of different classes to be treated as


objects of a common superclass, providing flexibility in code.
78. What is Inheritance?
○ Answer: Inheritance allows one class to inherit the properties and methods of
another, promoting code reuse and hierarchy.
79. What is a Class in Object-Oriented Programming?
○ Answer: A class is a blueprint for creating objects, defining attributes and
behaviors.
80. What is an Object in Object-Oriented Programming?
○ Answer: An object is an instance of a class, representing a real-world entity with
attributes and behaviors.

CHAPTER-3 BASIC PYTHON PROGRAMMING

FILL IN THE BLANKS[1 MARKS]

1. Python is an __________ programming language known for its simplicity and


readability. (Answer: interpreted)
2. Identifiers in Python must start with a __________ or an underscore. (Answer: letter)
3. __________ are reserved words in Python that cannot be used as identifiers.
(Answer: Keywords)
4. The __________ function is used to check the type of a variable in Python. (Answer:
type)
5. Python provides __________ and __________ types to distinguish between
mutable and immutable data types. (Answer: mutable, immutable)
6. Integer types in Python have a(n) __________ range. (Answer: unlimited)
7. Float types in Python are represented internally using the __________ standard.
(Answer: IEEE 754)
8. In Python, the assignment operator is represented by the __________ symbol.
(Answer: =)
9. The __________ operator is used to find the remainder of a division in Python.
(Answer: %)
10. In Python, __________ determines the order in which operators are evaluated.
(Answer: precedence)
11. __________ specifies the order in which operations of the same precedence are
performed. (Answer: associativity)
12. The __________ function can be used to explicitly convert one data type to another.
(Answer: int/float/str)
13. Python's __________ function returns the absolute value of a number. (Answer: abs)
14. Strings in Python are __________, meaning they cannot be changed after creation.
(Answer: immutable)
15. To access the first element of a string, the __________ index is used. (Answer: 0)
16. The __________ function is used to determine the length of a string. (Answer: len)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
20
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

17. The __________ method is used to convert all characters in a string to uppercase.
(Answer: upper)
18. In Python, the __________ operator can be used to concatenate two strings.
(Answer: +)
19. Strings can be compared using __________ operators like == and !=. (Answer:
relational)
20. The __________ function is used to display output to the console. (Answer: print)
21. To receive input from the user, the __________ function is used. (Answer: input)
22. __________ strings allow you to include variable values directly within a string using
curly braces. (Answer: f)
23. The __________ character is used to create a newline in console output. (Answer: \n)
24. __________ printing is used to control the alignment and precision of printed values.
(Answer: Formatted)
25. The __________ operators (and, or, not) are used to combine multiple conditions.
(Answer: logical)
26. __________ expressions allow you to write conditional statements in a single line.
(Answer: Conditional)
27. The __________ function returns True if all elements in an iterable are true. (Answer:
all)
28. The __________ function returns True if at least one element in an iterable is true.
(Answer: any)
29. The __________ statement is used as a placeholder for code that will be
implemented later. (Answer: pass)
30. A __________ loop is used when the number of iterations is known beforehand.
(Answer: for)
31. A __________ loop is used when the number of iterations depends on a condition.
(Answer: while)
32. The __________ statement is used to exit a loop prematurely. (Answer: break)
33. The __________ statement skips the current iteration of a loop. (Answer: continue)
34. The __________ block of a loop executes only if the loop terminates normally without
a break. (Answer: else)
35. A __________ is a blueprint for creating objects in Python. (Answer: class)
36. Objects are instances of __________. (Answer: classes)
37. A __________ method is defined within a class to initialize an object. (Answer: init)
38. The __________ keyword is used to create an instance of a class. (Answer: new)
39. Multiple __________ can be created from a single class. (Answer: objects)
40. In Python, the __________ keyword is used to define a class. (Answer: class)
41. A __________ is a file containing Python definitions and statements. (Answer:
module)
42. The __________ statement is used to include a module in another Python file.
(Answer: import)
43. To import only specific functions from a module, the __________ keyword is used.
(Answer: from)
44. Built-in modules like __________ provide mathematical functions. (Answer: math)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
21
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

45. The __________ module is used to generate random numbers. (Answer: random)
46. A __________ is an ordered collection that can hold a variety of object types.
(Answer: list)
47. A __________ is an unordered collection of unique elements. (Answer: set)
48. __________ is a collection type that stores key-value pairs. (Answer: dictionary)
49. __________ are immutable sequences of elements. (Answer: tuples)
50. Lists are __________, meaning they can be modified after creation. (Answer:
mutable)
51. A __________ is a note in the source code that is ignored by the Python interpreter.
(Answer: comment)
52. A __________ symbol is used to start a single-line comment in Python. (Answer: #)
53. Indentation in Python uses __________ instead of braces to define blocks of code.
(Answer: whitespace)
54. __________ strings can be used for multi-line comments. (Answer: Triple-quoted)
55. Python requires uniform __________ for proper execution. (Answer: indentation)
56. The __________ function converts a string to an integer. (Answer: int)
57. The __________ function converts a number to a string. (Answer: str)
58. The __________ function converts an integer to a float. (Answer: float)
59. The __________ method converts a string to lowercase. (Answer: lower)
60. The __________ method removes whitespace from both ends of a string. (Answer:
strip)
61. The __________ keyword is used to define a condition in a loop or decision
statement. (Answer: if)
62. A __________ loop is used to iterate over a sequence. (Answer: for)
63. In a while loop, the __________ condition is checked before executing the body.
(Answer: loop)
64. The __________ operator can be used to check membership in a collection. (Answer:
in)
65. The __________ operator is used to check identity of objects. (Answer: is)
66. The __________ function is used to round a number to a given precision. (Answer:
round)
67. The __________ function returns the largest item in an iterable. (Answer: max)
68. The __________ function returns the smallest item in an iterable. (Answer: min)
69. The __________ function is used to create an iterable range of numbers. (Answer:
range)
70. To define a function in Python, the __________ keyword is used. (Answer: def)
71. A __________ in Python is a special kind of string used for documentation. (Answer:
docstring)
72. __________ is a principle of OOP that hides the internal details of an object. (Answer:
Encapsulation)
73. __________ is the process by which one class inherits properties of another. (Answer:
Inheritance)
74. A __________ in Python is a sequence of instructions bundled together to perform a
task. (Answer: function)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
22
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

75. The __________ keyword is used to create a derived class. (Answer: class)
76. The __________ method is used to check if all characters in a string are digits.
(Answer: isdigit)
77. Python lists can be __________ using the append() method. (Answer: extended)
78. __________ are used to access elements of a dictionary. (Answer: Keys)
79. The __________ method is used to join elements of a list into a string. (Answer: join)
80. A Python __________ supports fast membership tests and unordered collections.
(Answer: set)
81. The __________ keyword is used to end a function definition. (Answer: return)
82. The __________ function generates a pseudo-random number between 0 and 1.
(Answer: random)
83. A Python __________ begins with a colon and is indented on subsequent lines.
(Answer: block)
84. The __________ operator is used to raise a number to a power. (Answer: **)
85. The __________ library is used for working with dates and times in Python. (Answer:
datetime)
86. The __________ statement is used to handle exceptions in Python. (Answer:
try-except)
87. Python's __________ function is used to get the ASCII value of a character. (Answer:
ord)
88. The __________ function is used to convert an ASCII value to a character. (Answer:
chr)
89. __________ loops allow iteration through items in a collection like lists. (Answer: For)
90. Python's __________ feature supports multiple assignments in a single statement.
(Answer: unpacking)
91. The __________ operator is used to calculate the integer quotient of a division.
(Answer: //)
92. Python tuples are __________, meaning their elements cannot be changed. (Answer:
immutable)
93. The __________ function returns a copy of a string with leading spaces removed.
(Answer: lstrip)
94. __________ are used to define code that executes repeatedly. (Answer: Loops)
95. The __________ function is used to evaluate a Python expression dynamically.
(Answer: eval)
96. Python's __________ operator compares two objects for equality. (Answer: ==)
97. A __________ is a built-in sequence used for character data. (Answer: string)
98. The __________ operator is used for string repetition. (Answer: *)
99. In Python, the __________ module provides functions for working with file systems.
(Answer: os)
100. The __________ method returns the position of a substring within a string.
(Answer: find)

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
23
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

SHORT TYPE QUESTION[1.5 MARK / 2 MARK]

1. What is an identifier in Python?


An identifier is the name used to identify variables, functions, or objects in Python.

2. What are Python keywords?


Reserved words in Python with specific meanings, like if, else, while, etc.

3. Name two rules for naming identifiers in Python.

○ Must begin with a letter or underscore.


○ Cannot contain special characters like @, #, $.
4. What is the difference between mutable and immutable types?
Mutable types can be modified after creation (e.g., List), whereas immutable types
cannot (e.g., Tuple).

5. Name two mutable and two immutable data types in Python.


Mutable: List, Dictionary. Immutable: String, Tuple.

6. What is the range of integers in Python?


Python integers have unlimited precision, limited only by memory.

7. What is the range of float values in Python?


Floats are represented using double precision (approx. ±1.8 × 10^308).

8. What are arithmetic operators in Python?


Operators like +, -, *, /, //, %, and **.

9. What is operator precedence?


Determines the order of evaluation of operators in expressions.

10. What is the associativity of the ** operator?


Right-to-left associativity.

11. What is type conversion in Python?


Changing a value's data type, e.g., int("10") converts a string to an integer.

12. What are built-in functions? Name two examples.


Functions provided by Python by default, e.g., len() and type().

13. What is the purpose of the import statement?


To use external modules or libraries in a Python program.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
24
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

14. What are container types? Name two examples.


Data structures that can hold multiple elements, e.g., List, Tuple.

15. What is the use of comments in Python?


Comments are used to describe the code and are ignored by the interpreter.

16. What is indentation in Python?


Whitespace at the beginning of a line to define code blocks.

17. How can you write multi-line statements in Python?


By using a backslash (\) or enclosing them in parentheses.

18. What is a class in Python?


A blueprint for creating objects, defined using the class keyword.

19. What is an object in Python?


An instance of a class.
20. Can multiple objects be created from one class? Give an example.

Yes. Example:

class Dog: pass

dog1 = Dog()

dog2 = Dog()

21. How do you access elements in a string?


Using indexing, e.g., s[0] accesses the first character.

22. What is string immutability?


Strings cannot be changed after they are created.

23. What is string slicing? Give an example.


Extracting a part of a string using indices. Example: s[1:4].

24. Name two string methods and their uses.


lower(): Converts to lowercase.
replace(): Replaces occurrences of a substring.

25. What does the len() function do for strings?


Returns the number of characters in the string.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
25
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

26. How can you concatenate strings in Python?


Using the + operator or join() method.

27. How do you compare two strings in Python?


Using relational operators like ==, <, >, etc.

28. What is the difference between isalpha() and isdigit() methods?


isalpha() checks if all characters are alphabets, isdigit() checks if all are digits.

29. What is the strip() method in strings?


Removes leading and trailing whitespace.

30. How can you convert a string to uppercase?


Using the upper() method.
31. What function is used to take user input in Python?
input() function.
32. What is formatted printing? Give an example.
Printing with specific formats using f-strings or format().
Example: print(f"Hello, {name}").
33. How do you print a string without a newline in Python?
Use end='' in the print() function.
34. Write an example of taking two inputs in one line.

a, b = input("Enter two values: ").split()

35. What are logical operators in Python?


and, or, and not.

36. What is the purpose of conditional expressions in Python?


To make decisions using a single line, e.g., x = 10 if a > b else 20.

37. What does the all() function do?


Returns True if all elements in an iterable are True.

38. What does the any() function do?


Returns True if at least one element in an iterable is True.

39. What is the pass statement used for?


It acts as a placeholder where no action is required.
40. Write an example of a simple if statement.

if x > 0:

print("Positive number")

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
26
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

41. What are the two types of loops in Python?


for loop and while loop.

42. What is the purpose of the break statement?


To exit a loop prematurely.

43. What is the purpose of the continue statement?


To skip the current iteration and continue with the next.

44. What is the else block in a loop?


Executes after the loop ends, unless terminated by break.
45. Write an example of a for loop.

for i in range(5):

print(i)

46. Write an example of a while loop.

i=0

while i < 5:

print(i)

i += 1

47. What is the difference between for and while loops?

for is used for definite iteration; while is used for indefinite iteration.

48. What is a nested loop? Give an example.

A loop inside another loop.

Example:

for i in range(3):

for j in range(2):

print(i, j)

49. What is the difference between for and while loops?


for is used for definite iteration; while is used for indefinite iteration.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
27
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

50. How do you loop through a dictionary in Python?

Using a for loop:


for key, value in my_dict.items():

print(key, value)

CHAPTER-4 LIST AND TUPLES IN PYTHON

FILL IN THE BLANKS[1 MARKS]

1. A list in Python is created using ______ brackets.

Ans: Square

2. To access the third element of a list named `my_list`, you use the index ______.

Ans: 2

3. The method to append an element to the end of a list is ______.

Ans: `append()`

4. To remove an element from a list by value, the method used is ______.

Ans: `remove()`

5. The ______ function returns the number of elements in a list.

Ans: `len()`

6. Slicing a list to get elements from the second to fifth position is done using ______.

Ans: `my_list[1:5]`

7. The ______ method sorts a list in-place.

Ans: `sort()`

8. To concatenate two lists `list1` and `list2`, you use the ______ operator.

Ans: `+`

9. A list can be iterated over using a ______ loop.

Ans: `for`

10. The method to count occurrences of an element in a list is ______.


Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
28
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

Ans: `count()`

11. A set in Python is created using ______ brackets.

Ans: Curly

12. To add an element to a set, the method used is ______.

Ans: `add()`

13. The method to remove an element from a set is ______.

Ans: `remove()`

14. A set does not allow ______ elements.

Ans: Duplicate

15. To check if an element exists in a set, the ______ operator is used.

Ans: `in`

16. The method to find the union of two sets is ______.

Ans: `union()`

17. The method to find the intersection of two sets is ______.

Ans: `intersection()`

18. To create an empty set, you use the ______ function.

Ans: `set()`

19. The method to clear all elements from a set is ______.

Ans: `clear()`

20. The ______ method returns the difference between two sets.

Ans: `difference()`

21. A tuple in Python is created using ______ brackets.

Ans: Parentheses

22. Tuples are ______, meaning they cannot be changed after creation.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
29
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

Ans: Immutable

23. To access the first element of a tuple named `my_tuple`, you use the index ______.

Ans: 0

24. The method to count occurrences of an element in a tuple is ______.

Ans: `count()`

25. The method to find the index of an element in a tuple is ______.

Ans: `index()`

26. Tuples can be ______ to form a larger tuple.

Ans: Concatenated

27. The function to convert a list to a tuple is ______.

Ans: `tuple()`

28. Tuples can store ______ types of elements.

Ans: Mixed

29. The function to find the length of a tuple is ______.

Ans: `len()`

30. The ______ operator is used to check if an element exists in a tuple.

Ans: `in`

31. A dictionary in Python is created using ______ brackets.

Ans: Curly

32. A dictionary consists of key-value ______.

Ans: Pairs

33. To access the value associated with a key `my_key` in a dictionary `my_dict`, you use
______.

Ans: `my_dict[my_key]`

34. The method to add or update a key-value pair in a dictionary is ______.


Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
30
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

Ans: `update()`

35. The method to get all keys in a dictionary is ______.

Ans: `keys()`

36. The method to get all values in a dictionary is ______.

Ans: `values()`

37. To remove a key-value pair from a dictionary, the method used is ______.

Ans: `pop()`

38. The ______ method returns the key-value pairs in a dictionary as tuples.

Ans: `items()`

39. To check if a key exists in a dictionary, the ______ operator is used.

Ans: `in`

40. The method to clear all elements from a dictionary is ______.

Ans: `clear()`

41. A list comprehension is enclosed in ______ brackets.

Ans: Square

42. The syntax for a list comprehension is [______ for x in iterable].

Ans: Expression

43. List comprehensions can include an optional ______ clause.

Ans: `if`

44. To create a list of squares of numbers from 1 to 5, you use [______ for x in range(1, 6)].

Ans: `x**2`

45. List comprehensions can replace the use of ______ loops for creating lists.

Ans: `for`

46. To filter elements in a list comprehension, the syntax is [______ for x in iterable if
condition].
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
31
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

Ans: Expression

47. A list comprehension can include multiple ______ expressions.

Ans: `for`

48. The expression [x + y for x in [1, 2] for y in [10, 20]] creates a list of ______.

Ans: `[11, 21, 12, 22]`

49. List comprehensions are a ______ way to create lists.

Ans: Concise

50. To create a list of even numbers from 1 to 10, the comprehension used is [______ for x in
range(1, 11) if x % 2 == 0].

Ans: `x`

51. A set comprehension is enclosed in ______ brackets.

Ans: Curly

52. The syntax for a set comprehension is {______ for x in iterable}.

Ans: Expression

53. Set comprehensions can include an optional ______ clause.

Ans: `if`

54. To create a set of squares of numbers from 1 to 5, you use {______ for x in range(1, 6)}.

Ans: `x**2`

55. Set comprehensions can replace the use of ______ loops for creating sets.

Ans: `for`

56. To filter elements in a set comprehension, the syntax is {______ for x in iterable if
condition}.

Ans: Expression

57. A set comprehension can include multiple ______ expressions.

Ans: `for`

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
32
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

58. The expression {x + y for x in [1, 2] for y in [10, 20]} creates a set of ______.

Ans: `{11, 12, 21, 22}`

59. Set comprehensions are a ______ way to create sets.

Ans: Concise

60. To create a set of even numbers from 1 to 10, the comprehension used is {______ for x in
range(1, 11) if x % 2 == 0}.

Ans: `x`

61. A dictionary comprehension is enclosed in ______ brackets.

Ans: Curly

62. The syntax for a dictionary comprehension is {k: v for k, v in ______}.

Ans: iterable

63. Dictionary comprehensions can include an optional ______ clause.

Ans: `if`

64. To create a dictionary of numbers and their squares from 1 to 5, you use {x: ______ for x
in range(1, 6)}.

Ans: `x**2`

65. Dictionary comprehensions can replace the use of ______ loops for creating dictionaries.

Ans: `for`

66. To filter elements in a dictionary comprehension, the syntax is {k: v for k, v in iterable if
______}.

Ans: condition

67. A dictionary comprehension can include multiple ______ expressions.

Ans: `for`

68. The expression {x: y for x in [1, 2] for y in [10, 20]} creates a dictionary with keys ______.

Ans: `1` and `2`

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
33
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

69. Dictionary comprehensions are a ______ way to create dictionaries.

Ans: Concise

70. To create a dictionary of even numbers and their halves from 1 to 10, the comprehension
used is {x: x / ______ for x in range(1, 11) if x % 2 == 0}.

Ans: `2`

71. A function in Python is defined using the ______ keyword.

Ans: def`

72. The syntax for defining a function is def function_name(______).

Ans: parameters

73. To call a function named `my_function`, you use ______.

Ans: `my_function()`

74. Built-in functions in Python include ______, `len()`, and `type()`.

Ans: `print()`

75. User-defined functions are created by the ______.

Ans: programmer

76. The ______ statement is used to return a value from a function.

Ans: `return`

77. Arguments passed to a function can be positional or ______ arguments.

Ans: keyword

78. To unpack arguments from a list, you use the ______ operator.

Ans: `*`

79. To unpack arguments from a dictionary, you use the ______ operator.

Ans: `**`

80. A recursive function is a function that calls ______.

Ans: itself
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
34
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

81. Iteration is often used in place of ______ for looping structures.

Ans: recursion

82. Recursive functions must have a ______ condition to prevent infinite loops.

Ans: base

83. The difference between iteration and recursion is that iteration uses loops, while recursion
uses ______ calls.

Ans: function

84. Functions can have default ______ for parameters.

Ans: values

85. The function `lambda x: x + 1` is an example of a ______ function.

Ans: lambda

86. Functions can return multiple ______.

Ans: values

87. The ______ function can apply a function to all items in an iterable.

Ans: `map()`

SHORT TYPE QUESTIONS[1.5 MARKS/2 MARKS]

1. How do you create a list in Python?


A list is created using square brackets [] and can contain elements of any data type.
Example: my_list = [1, "Python", 3.14].
2. What is the difference between append() and extend() methods in lists?
○ append(): Adds a single element to the end of the list.
○ extend(): Adds all elements of an iterable (e.g., another list) to the list.
3. What is list slicing? Provide an example.
Slicing extracts a portion of a list using list[start:end:step].
Example: my_list[1:4] extracts elements from index 1 to 3.
4. What is the difference between pop() and remove() methods in lists?

○ pop(index): Removes and returns the element at the specified index.


○ remove(value): Removes the first occurrence of the specified value.
5. How do you loop through a list using a for loop? Provide an example.

Example:

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
35
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

for item in my_list:

print(item)

6. What is a set in Python? How is it created?


A set is an unordered, mutable collection of unique elements.
Example: my_set = {1, 2, 3}.
7. What is the difference between add() and update() methods in sets?
○ add(): Adds a single element to the set.
○ update(): Adds multiple elements from an iterable.
8. What is the purpose of the union() method in sets?
It returns a new set containing all unique elements from two or more sets.
Example: set1.union(set2).
9. What is the intersection() method in sets? Provide an example.
Returns the common elements between two sets.
Example: set1.intersection(set2).
10. How do you remove an element from a set? Name two methods.

○ remove(element): Removes the specified element, raises an error if not found.


○ discard(element): Removes the specified element, does nothing if not found.
11. What is a tuple? How is it different from a list?
A tuple is an immutable sequence, created using parentheses (). Unlike lists, tuples
cannot be modified after creation.
12. How do you create a tuple with one element?
Use a trailing comma: single_tuple = (42,).
13. What is tuple unpacking? Provide an example.
Assigning tuple elements to multiple variables.
Example:

a, b, c = (1, 2, 3)
14. What is the purpose of the count() method in tuples?
It returns the number of occurrences of a specified value.
Example: (1, 2, 2, 3).count(2) returns 2.
15. Can you modify a tuple? If not, why?
No, tuples are immutable, meaning their elements cannot be changed after creation.
16. How do you create a dictionary in Python?
Using curly braces {} with key-value pairs.
Example: my_dict = {"name": "John", "age": 30}.
17. How do you access a value in a dictionary?
By using its key.
Example: my_dict["name"] returns "John".
18. What is the purpose of the get() method in dictionaries?
It retrieves a value for a key and returns None if the key does not exist.
Example: my_dict.get("name").

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
36
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

19. How do you loop through keys and values of a dictionary?


Example:

for key, value in my_dict.items():

print(key, value)

20. What does the pop() method do in dictionaries?


Removes and returns the value of a specified key.
Example: my_dict.pop("age").
21. What is the difference between len() and max() functions?
○ len(): Returns the number of elements in a collection.
○ max(): Returns the largest element in a collection.
22. What is a comprehension in Python? Name three types.
A compact way to generate lists, sets, or dictionaries.
Types: List comprehension, Set comprehension, Dictionary comprehension.
23. Write an example of list comprehension.
Example: [x**2 for x in range(5)] generates [0, 1, 4, 9, 16].
24. Write an example of set comprehension.
Example: {x**2 for x in range(5)} generates {0, 1, 4, 9, 16}.
25. Write an example of dictionary comprehension.
Example: {x: x**2 for x in range(5)} generates {0: 0, 1: 1, 2: 4, 3: 9, 4: 16}.
26. How do you define a function in Python?
Using the def keyword.
Example:

def greet():

print("Hello!")

27. What is a built-in function? Give two examples.


Functions provided by Python, such as len() and sum().
28. What is a user-defined function?
A function written by the programmer using the def keyword.
29. How do you pass multiple arguments to a function?
By using *args for positional arguments or **kwargs for keyword arguments.
30. Write an example of a function that returns a value.
Example:

def square(x):

return x**2

31. What is recursion?


A function that calls itself to solve smaller subproblems.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
37
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

32. What is a base case in recursion?


A condition that stops the recursion to prevent infinite loops.
33. Write a simple recursive function to calculate factorial.
Example:

def factorial(n):

if n == 0:

return 1

return n * factorial(n - 1)

34. What is the difference between recursion and iteration?


○ Recursion uses function calls to repeat.
○ Iteration uses loops like for or while.
35. Which is more memory-efficient: recursion or iteration? Why?
Iteration is more memory-efficient because recursion uses the call stack.
36. What is unpacking in Python functions?
Distributing elements of a collection into function arguments.
Example: sum(*[1, 2, 3]).
37. What is the difference between map() and filter() functions?
○ map(): Applies a function to all elements of an iterable.
○ filter(): Filters elements based on a condition.
38. Write an example of a lambda function.
Example: square = lambda x: x**2.
39. What does the zip() function do?
Combines elements from multiple iterables into tuples.
Example: zip([1, 2], ['a', 'b']) returns [(1, 'a'), (2, 'b')].
40. What does the reduce() function do?
Applies a rolling computation to items in an iterable.
Example: Calculating the sum of a list.
41. What does the sorted() function do?
Returns a sorted list of elements from an iterable.
42. What is the difference between is and == operators?
○ is: Checks object identity.
○ ==: Checks object equality.
43. What does the enumerate() function do?
Returns a tuple of index and value for each element in an iterable.
44. What does the range() function generate?
A sequence of numbers.
45. How do you create an empty dictionary?
Example: my_dict = {}.
46. How do you create an empty set?
Example: my_set = set().

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
38
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

47. What is the default return value of a function?


None.
48. What is the difference between all() and any() functions?
○ all(): Returns True if all elements are truthy.
○ any(): Returns True if at least one element is truthy.
49. What is the difference between filter() and list comprehensions?
List comprehensions are more concise and flexible.
50. What is a higher-order function?
A function that takes another function as an argument or returns one.

PROBABLE 5 MARKS QUESTIONS

UNIT-1

1. Explain the generations of computers and their characteristics.


2. Describe the block diagram of a computer system and explain the functions of the
CPU, Memory unit, and Storage devices.
3. Explain the memory hierarchy in computer systems with an example.
4. Compare and contrast primary and secondary memory with examples.
5. What are the different types of input and output devices? Explain the functions of at
least five input and five output devices.
6. What are the different types of software in a computer system? Explain System
software, Application software, Utility software, and Firmware.
7. Describe the importance of networking in computer systems and explain different
network types such as LAN, MAN, and WAN.
8. Explain the role and functions of network devices such as Repeater, Bridge, Hub,
Switch, Router, and Gateway.

UNIT-2

9. What is an algorithm? Explain how pseudo-code is used in algorithm design.


10. Describe the different control structures in algorithms with examples.
11. Draw a flowchart for a simple program (e.g., calculating factorial) and explain the
symbols used.
12. What are the top-down and bottom-up approaches in program design? Explain with
examples.
13. Discuss the characteristics of a good program.
14. Explain the different generations of programming languages with examples.
15. What is a translator in programming? Explain the difference between an assembler,
compiler, and interpreter.
16. Describe the functions of a linker, loader, and an integrated development environment
(IDE) in program development.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
39
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

17. What are the various types of programming errors? Explain syntax, semantic, logical,
compile-time, and runtime errors with examples.

UNIT-3

21. What are identifiers in Python? Explain the rules for naming identifiers.
22. What are Python’s basic data types? Discuss variables and type assignment in Python..
23. What are arithmetic operators in Python? Explain operator precedence and
associativity with examples.
24. Explain the use of built-in functions and modules in Python.
25. What are container types in Python? Explain lists, tuples, and dictionaries.
26. What are Python strings? Explain string operations like accessing elements, slicing, and
string methods.

UNIT-4

31. What are lists in Python? Explain how to create, access, and modify lists.
32. What are sets in Python? Explain the operations and methods associated with sets.
33. What are tuples in Python? Discuss how they differ from lists and explain their uses.
34. What are dictionaries in Python? Discuss key-value pairs and methods like get(),
items(), and keys().
35. Explain comprehensions in Python for lists, sets, and dictionaries. Provide examples.
36. Explain user-defined functions in Python. How are functions defined and invoked?
37. What are recursive functions in Python? Explain with an example.
38. Compare iteration and recursion. Discuss the advantages and disadvantages of each.
39. What are built-in functions in Python? Provide examples of commonly used functions
like len(), sum(), min(), etc.
40. What are the differences between mutable and immutable data structures in Python?
Explain with examples.

PROBABLE LONG QUESTIONS[8 MARKS]

1. **Describe the different generations of computers, highlighting the key advancements


and characteristics of each generation.**

- Discuss the evolution from vacuum tubes to transistors, integrated circuits,


microprocessors, and beyond.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
40
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

2. **Explain the block diagram of a computer system, detailing the functions of the CPU,
memory unit, and storage devices.**

- Include the roles of the ALU, CU, registers, RAM, ROM, and secondary storage devices.

3. **Discuss the hierarchy of computer memory, including CPU registers, cache memory,
primary memory, and secondary memory.**

- Explain the different access methods and how they impact system performance.

4. **Differentiate between various types of input and output devices, providing examples
and their functions in a computer system.**

- Include devices like keyboards, mice, scanners, printers, monitors, and speakers.

5. **Explain the different types of software (system software, application software, utility
software, and firmware) and their roles in a computer system.**

- Provide examples and their specific functions within the system.

6. **Outline the steps involved in problem analysis, program design, and development,
and explain the importance of each step.**

- Cover stages such as defining the problem, designing algorithms, coding, testing, and
debugging.

7. **Define and explain the importance of pseudocode and control structures in


programming, providing examples.**

- Discuss how pseudocode aids in planning and control structures manage the flow of a
program.

8. **Compare and contrast structured programming and object-oriented programming,


including their principles and advantages.**

- Highlight the concepts of procedural abstraction, data encapsulation, inheritance, and


polymorphism.

9. **Describe the differences between low-level and high-level programming languages,


and the advantages and disadvantages of each.**

- Include examples of assembly language (low-level) and languages like Python or Java
(high-level).

10. **Explain the roles of different types of translators (assembler, compiler, and
interpreter) in programming.**

- Discuss how each translator works and the differences in their processing methods.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
41
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

11. **Discuss the fundamental concepts of Python, including identifiers, keywords, and
different data types. Provide examples.**

- Cover basic types, mutable and immutable types, and the usage of int, float, str, and bool.

12. **Explain type conversion in Python, including implicit and explicit conversions, with
relevant code examples.**

- Discuss functions like `int()`, `float()`, and `str()`, and the concept of type coercion in
expressions.

13. **Describe the process and significance of string operations in Python, including
accessing elements, using methods, and converting strings.**

- Include examples of methods like `upper()`, `lower()`, `replace()`, and string slicing.

14. **Explain the use of decision control instructions (if-else statements) and repetition
control instructions (loops) in Python, with examples.**

- Cover the syntax and usage of `if`, `elif`, `else`, `for`, and `while` loops, including
`break` and `continue`.

15. **Discuss the different ways to perform input and output operations in Python,
including formatted printing. Provide code examples.**

- Include the use of `input()`, `print()`, and formatting techniques like f-strings.

16. **Explain the process of creating and manipulating lists, sets, tuples, and dictionaries
in Python, with examples demonstrating various operations.**

- Discuss methods like `append()`, `remove()`, `union()`, and `update()`.

17. **Describe list comprehensions, set comprehensions, and dictionary comprehensions


in Python, providing examples showing how each is used to create new collections.**

- Highlight the syntax and advantages of using comprehensions.

18. Compare and contrast iterative and recursive approaches in programming,


specifically in Python, with examples to illustrate their usage.

- Explain the concepts of base cases and recursive calls, and provide code examples.

19. Discuss the use of classes and objects in Python, including the concepts of
inheritance, polymorphism, and encapsulation. Provide code examples.

- Cover the use of constructors (`__init__`), methods, and overriding methods.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
42
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE

20. Explain the concept and usage of functions in Python, differentiating between
built-in and user-defined functions. Provide examples of function definitions and
invocations.

- Discuss default arguments, keyword arguments, and the use of `*args` and `**kwargs`.

Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
43

You might also like