stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
CPSC610, Module 3 Flashcards | StudBud
Explore
/
CPSC610, Module 3
CPSC610, Module 3
16 terms
·
StudBud Administration
·
29 plays
Imported from external platform
Flashcards
16 cards
F
Practice quiz
P
Host live
L
Questions
16
Answers
1
Which of the following correctly defines a lambda function that adds two numbers?
add = lambda x, y: x + y
lambda x, y: return x + y
lambda add(x,y): x + y
def add(x, y): return x + y
2
What is
SciPy
mainly used for in Python?
Creating animations
Web development
Scientific and technical computing
Managing user authentication
3
Which of the following correctly uses a built-in function to manipulate a list in Python?
list.reverse([1, 2, 3])
reversed([1, 2, 3])
[1, 2, 3].reverse()
reverse([1, 2, 3])
4
Among the following options, which one is not a Python package for visualization?
seaborn
ggplot2
matplotlib
plotly
5
What keyword is used to define a function in Python?
function
def
define
create
6
What will be the output of the following code snippet?
None
3 * 5
multiply
15
7
Which of the following is required to define a Python package?
A script named main.py
A folder containing .py files with related files with related functionality
A module with reusable functions
A file named __init__.py inside a folder
8
Given the code below, what will be the output?
The code will cause an error.
Two identical random integers between 1 and 100.
Two different random integers between 1 and 100.
The first random integer will be fixed while the second one varies.
9
What happens when the following code is executed?
The array is converted into a Python list.
The array remains unchanged.
The code will cause an error due to invalid multiplication.
Each element in the array is multiplied by 2.
10
Which of the following
numPy
operations utilizes broadcasting?
Reshaping an array.
Converting an array to a list.
Accessing an element using indexing.
Adding a scalar value to every element in an array.
11
What is the primary function of the
math
module in Python?
To provide mathematical functions like trigonometry and logarithms
To handle complex algorithms for artificial intelligence.
To store large sets of data efficiently.
To create graphical interfaces for Python applications.
12
What is the main purpose of splitting data into training and testing sets in machine learning?
To allow the model to memorize examples
To make computations faster
To reduce the number of features in the dataset
To ensure the model generalizes well to unseen data
13
What is the key advantage of using a
pandas
DataFrame over a
numPy
array for data analysis?
DataFrames require external databases to function.
DataFrames store data in plain text for easy readability.
NumPy arrays are always slower than Pandas DataFrames.
DataFrames allow handling of labeled structured data and mixed data types.
14
What is a key advantage of using
numPy
arrays over Python lists?
numPy arrays allow faster and more efficient numerical operations.
numPy arrays support multiple data types in a single array.
numPy arrays can only store string values.
numPy arrays replace the need for Python functions.
15
Which of the following best describes the advantage of using packages in Python?
Packages automatically execute all modules on program start
Packages allow modular programming and reduce code redundancy
Packages prevent the need for loops in a program
Packages store data permanently for all modules
16
Consider the following package structure. What happens when the following code is executed?
mypackage is imported, but no modules are loaded until explicitly called.
The code will raise an error since modules must be imported separately.
module1.py and module2.py are automatically executed.
Only module1.py gets executed.