1/142
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What has happened to the volume of global data over time?
Increased exponentially
Which field of computer science simulates human conversation?
Artificial Intelligence
What percentage increase in data science jobs is predicted by the U.S. Bureau of Labor Statistics by 2030?
30%
What type of data includes texts, images, or videos?
Unstructured data
What job role mainly focuses on analyzing and interpreting data?
Data analyst
Which professional develops websites?
Computer scientist
What type of bias occurs when the training data does not represent all groups equally?
Algorithmic bias
What scenario best describes algorithmic bias?
A model that accepts or rejects applications where males are more likely to apply.
What do data centers consume a lot of that contributes to carbon emissions?
Energy
What is a sequence of instructions that solves a problem called?
Algorithm
What translates high-level language into machine instructions?
Compiler
Which program can create Python code directly runnable by the interpreter?
IDLE Editor
What manages programs and interfaces with peripherals?
Operating system
What does 'dynamic typing' mean in Python?
Variable types are assigned automatically at runtime.
In which year did Python begin development?
1980
What is true about Python?
Python is free to use; developers don't usually pay a fee.
What symbol can be used in a Python identifier?
Underscore (_)
What does 'keyword' mean in Python?
A reserved word that cannot be used as a variable name.
What is dividing by zero an example of?
Logic error
Which error type does not stop program execution?
Logic error
What is the name of the process for removing errors from code?
Debugging
What type of error occurs when a variable name is used incorrectly?
NameError
What command is used to intentionally pause execution during development?
raise NotImplementedError
What keyword ends a loop early when a condition is met?
break
What keyword skips to the next iteration of a loop?
continue
Which statement keeps executing as long as the condition is true?
while loop
What is an essential feature of a while loop?
The loop expression must change within the loop body.
How many times will for i in range(1, 3): run?
2
How many times does while i <= 100: i = i + 2 iterate?
51
What output does for i in range(2): for j in range(3): print(i,j) produce?
0 0, 0 1, 0 2, 1 0, 1 1, 1 2
Which loop structure is best for unknown repetition?
while loop
Which is best for a known range of repetition?
for loop
Which keyword defines a function?
def
What is the value returned by def calc(a,b): return 1+a+b called as calc(4,5)?
10
Which of the following is not a valid function stub?
Leaving the function body empty
What is the purpose of function stubs?
Helps with incremental programming and testing
What happens when a function finishes execution?
Control returns to the calling line.
What is a variable that stores a function's output called?
Return value
What is the special variable __main__ used for?
Indicates whether a script is being run directly or imported.
What is scope resolution in Python?
The process of searching namespaces for variable definitions.
What does my_list = [1,2,3,4]; my_list[0:-1:3] return?
[1, 4]
What is the output of 'Python'[0:3]?
Pyt
What does .sort() do to a list?
Modifies the list in place by sorting it.
What does sorted() return?
A new sorted list, leaving the original unchanged.
What will all([0,1,2]) return?
False
What is the result of [i**2 for i in [1,2,3,4]]?
[1, 4, 9, 16]
What is slicing?
Extracting a portion of a list or string using index notation.
What is the output of 'Berlin is the capital of Germany'[-18:]?
'capital of Germany'
What is NumPy used for?
Numerical computations and arrays
What is Pandas used for?
Data manipulation and analysis
What is Matplotlib used for?
Plotting and data visualization
What does np.transpose(arr) do?
Flips rows and columns in a NumPy array
What does dat.iloc[1:3, 0:2] select?
Rows 1-2 and columns 0-1 from a DataFrame
What does plt.scatter(x, y) do?
Creates a scatter plot
What does plt.plot(xx, 4*xx - 3) show?
A linear relationship between x and y
What command sets x-axis label?
plt.xlabel('Label')
What command sets a plot title?
plt.title('My Plot')
How do you access a value safely in a dictionary?
dict.get(key, default)
What is a dictionary comprehension example?
{x: x*x for x in range(5)}
What does mydict['third'] = 5 do?
Updates the key 'third' with value 5
What are curly braces {} used for?
To define a set or dictionary
What does {'yellow', 'red', 'green'} represent?
A set
What is the command to execute an SQL query in Python?
dbCursor.execute(query, data)
Which method retrieves all rows of the result set?
.fetchall()
What must be done after database operations?
Close the cursor using .close()
What does dataframe.insert() do in pandas?
Inserts a new column into a DataFrame
What is the output of not(x) and (y == a)?
True only when x is False and y equals a
What is a ternary operator in Python?
a = b if condition else c
What does % do in Python?
Returns the remainder of a division
What does // do?
Integer division
What is an example of operator precedence?
Multiplication before addition
What does this code output? i = 5; while i < 10: print(i); i += 1
Prints 5 6 7 8 9
What does this code output? x = 18; while x % 3 == 0: print(x, end=' '); x = x // 3
18 6 2
What's the purpose of break in a loop?
Immediately exits the current loop
What's the purpose of continue in a loop?
Skips the remaining body and proceeds to the next iteration
What does while i <= 6: x += i; i += 2 do?
Adds every other number (1, 3, 5) until 6
What does this output? for j in range(2): for k in range(4): if k == 2: break; print(f'{j}{k}', end=' ')
00 01 10 11
How do nested loops behave?
Inner loops complete all iterations for each outer loop iteration
What's the output? num = 10; while num <= 15: print(num, end=' '); if num == 12: break; num += 1
10 11 12
What happens if a while loop never changes its condition variable?
Infinite loop
What does this output? count = 0; while count < 3: print('loop'); count += 1; print(count)
Prints 'loop' 3 times and final value 3
What is the effect of indentation in Python loops?
Determines the scope of loop body — incorrect indentation causes IndentationError.
What does math.pow(2, 3) return?
8.0
What does math.sqrt(16) return?
4.0
What does math.ceil(0.3) return?
1
What's the result of round(4.6)?
5
Which module is used for random number generation?
random
What does random.randrange(7) do?
Returns a random integer between 0-6
What's the result of abs(-7)?
7
What does max(3, 5, 2) return?
5
What does min(3, 5, 2) return?
2
Which operator gives the remainder of a division?
%
What does // do?
Performs floor (integer) division
What's the operator for exponentiation?
**
What's the output of 2 * 3 * 2?
512 because it's right-associative: 2^(3^2)
Which library must be imported before using math.pow()?
import math
What does this output? def calc_square(x): return x * x; print(calc_square(calc_square(2)))
16
What is the output of print_shipping_charge(18) if defined with (item_weight * 0.95) for 15-20 range?
17.1
What is the output of print_shipping_charge(6) given the 0-10 range formula (item_weight * 0.75)?
4.5
What is the output of print_shipping_charge(25)?
Nothing printed — no matching elif condition