Core 1 Sample Paper
Core 1 Sample Paper
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
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)
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
5
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
6
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
7
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
8
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
○ 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.
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
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)
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
13
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
14
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
15
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
16
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
17
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
Answer: Time complexity refers to the amount of time an algorithm takes to run as a
function of the size of the input.
Answer: Flowcharts help visually represent the logic of an algorithm, making it easier
to design, understand, and communicate.
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
18
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
Answer: Compile-time errors are detected during code compilation, while link-time
errors occur when object files are being linked to create the executable.
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
19
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
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
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
24
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
Yes. Example:
dog1 = Dog()
dog2 = Dog()
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
25
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
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
for i in range(5):
print(i)
i=0
while i < 5:
print(i)
i += 1
for is used for definite iteration; while is used for indefinite iteration.
Example:
for i in range(3):
for j in range(2):
print(i, j)
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
27
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
print(key, value)
Ans: Square
2. To access the third element of a list named `my_list`, you use the index ______.
Ans: 2
Ans: `append()`
Ans: `remove()`
Ans: `len()`
6. Slicing a list to get elements from the second to fifth position is done using ______.
Ans: `my_list[1:5]`
Ans: `sort()`
8. To concatenate two lists `list1` and `list2`, you use the ______ operator.
Ans: `+`
Ans: `for`
Ans: `count()`
Ans: Curly
Ans: `add()`
Ans: `remove()`
Ans: Duplicate
Ans: `in`
Ans: `union()`
Ans: `intersection()`
Ans: `set()`
Ans: `clear()`
20. The ______ method returns the difference between two sets.
Ans: `difference()`
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
Ans: `count()`
Ans: `index()`
Ans: Concatenated
Ans: `tuple()`
Ans: Mixed
Ans: `len()`
Ans: `in`
Ans: Curly
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]`
Ans: `update()`
Ans: `keys()`
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()`
Ans: `in`
Ans: `clear()`
Ans: Square
Ans: Expression
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
Ans: `for`
48. The expression [x + y for x in [1, 2] for y in [10, 20]] creates a list of ______.
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`
Ans: Curly
Ans: Expression
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
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: 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`
Ans: Curly
Ans: iterable
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
Ans: `for`
68. The expression {x: y for x in [1, 2] for y in [10, 20]} creates a dictionary with keys ______.
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
33
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
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`
Ans: def`
Ans: parameters
Ans: `my_function()`
Ans: `print()`
Ans: programmer
Ans: `return`
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: `**`
Ans: itself
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
34
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
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
Ans: values
Ans: lambda
Ans: values
87. The ______ function can apply a function to all items in an iterable.
Ans: `map()`
Example:
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
35
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
print(item)
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
print(key, value)
def greet():
print("Hello!")
def square(x):
return x**2
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
37
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
def factorial(n):
if n == 0:
return 1
return n * factorial(n - 1)
Prepared By: Chinmay Kumar Mahanta (Lecturer in Computer Science ,Pragati Degree College)
38
SAMPLE PAPERS(INTRODUCTION TO PYTHON PROGRAMMING) | PRAGATI DEGREE COLLEGE
UNIT-1
UNIT-2
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.
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.**
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.
- Discuss how pseudocode aids in planning and control structures manage the flow of a
program.
- 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.**
- 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.
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