Computer Programming
Computer Programming
True
False
a) Tkinter
b) NumPy
c) Matplotlib
d) Pandas
b) James Gosling
c) Bjarne Stroustrup
d) Dennis Ritchie
Advanced data structures in Python include heaps, graphs, and linked lists, which provide
more efficient ways to handle complex data.
True
False
What type of error occurs when a program encounters a problem that causes it to terminate
unexpectedly?
a) Syntax error
b) Runtime error
c) Logic error
d) Indentation error
a) math
b) statistics
c) random
d) numpy
The software development life cycle includes stages such as requirements gathering, design,
implementation, testing, and maintenance.
True
False
10
11
c) To define a function
12
13
True
False
14
Git is a version control system that helps manage changes to code and allows for
collaboration among developers.
True
False
15
How many marks are allocated for quizzes, assignments, group work, and presentations in
the continuous assessment?
a) 10 marks
b) 20 marks
c) 30 marks
d) 40 marks
16
d) To manage databases
17
b) To define functions
c) To create classes
d) To handle exceptions
18
19
Best practices in Python programming are optional and can be ignored without affecting
code quality.
True
False
20
a) open()
b) write()
c) read()
d) close()
21
22
True
False
23
True
False
24
25
What is a consequence of being late to class according to the Code of Ethics for Students?
27
Testing in Python is only necessary for large projects and not for smaller ones.
True
False
28
29
30
32
True
False
33
a) def
b) function
c) define
d) method
34
True
False
35
b) To enable methods to take on different forms based on the object calling them
37
True
False
38
a) True
b) False
c) None
d) Error
39
True
False
40
Command-line applications provide a simple way for users to interact with software through
text commands.
True
False
42
In Python, a program can decide which statements to execute based on a condition using
selection statements such as if and if-else.
True
False
43
True
False
44
What module in Python provides additional mathematical functions beyond the built-in
ones?
a) numpy
b) math
c) statistics
d) random
45
Docker allows you to create, deploy, and run applications in containers, ensuring consistency
across environments.
True
False
46
False
47
In object-oriented programming, a class defines properties and behaviors for objects, while
objects are instances of classes with unique identities.
True
False
48
49
A recursive function solves a problem by calling itself to handle smaller instances of that
problem.
True
False
50
51
52
Flask is a micro web framework for Python that makes it easy to create web applications and
APIs.
True
False
53
54
What is the primary data structure used by Pandas for handling structured data?
a) Series
b) Matrix
c) DataFrame
d) Array
55
Matplotlib can create various types of plots, including line, bar, histogram, and scatter plots.
True
False
56
What is a common mistake that can occur when using loops in Python?
58
True
False
59
60
What is a common technique for handling missing values in a dataset during data cleaning?
61
Machine learning involves using algorithms to analyze data and make predictions or
decisions based on that data.
True
False
62
True
False
63
64
Inheritance allows a new class to inherit properties and methods from an existing class in
object-oriented programming.
True
False
65
Matplotlib is primarily used for creating static, animated, and interactive visualizations in
Python.
True
False
66
Hide
True
False
68
What is one of the key advantages of using Numpy arrays over standard Python lists?
69
True
False
70
True
False
71
Debugging is the process of identifying and removing errors from computer hardware or
software.
True
False
72
What is the main difference between the assignment operator (=) and the equality operator
(==) in Python?
a) The assignment operator assigns a value to a variable, while the equality operator checks
if two values are equal.
b) The assignment operator checks if two values are equal, while the equality operator
assigns a value to a variable.
c) The assignment operator is used for mathematical calculations, while the equality
operator is used for logical operations.
d) The assignment operator can only be used with numbers, while the equality operator can
be used with any data type.
73
True
False
74
What is a key difference between mutable and immutable data structures in Python?
75
True
False
76
True
False
77
78
True
False
79
80
A syntax error in Python occurs due to mistakes in code construction, such as mistyping a
statement.
True
False
81
Cybersecurity involves protecting systems and data from threats and vulnerabilities.
True
False
82
NumPy is the core library for scientific computing in Python and provides high-performance
multidimensional array objects.
True
False
84
85
86
In Python, the try block is used to handle exceptions and prevent the program from crashing
when an error occurs.
True
False
87
In Python, files can be opened, read, written, and closed using built-in functions for file
handling.
True
False
88
89
90
91
The Python math module provides built-in mathematical functions like sqrt(), sin(), and
cos().
True
False
92
a) Tkinter
b) NumPy
c) Matplotlib
d) Pandas
93
What is the purpose of using a context manager when handling files in Python?
94
Libraries in Python provide pre-written code for common tasks, enhancing functionality and
productivity.
True
False
95
Data science involves using statistical methods and algorithms to analyze and interpret
complex data.
True
False
96
In Python, incorrect indentation can lead to syntax errors and runtime issues.
True
False
97
99
Python was created by Guido van Rossum in 1990 and is named after Monty Python's Flying
Circus.
True
False
100
101
What type of error occurs when the program has incorrect syntax and cannot be executed?
a) Runtime error
b) Logic error
c) Syntax error
d) Type error
102
Cloud computing allows for scalable and flexible access to computing resources over the
internet.
True
False
103
104
True
False