1/18
module r2
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
The Python keyword used to define a function.
def
Type of error caused by incorrect code structure or missing syntax.
Syntax Error
The built-in function used to determine the length of a sequence.
len()
A Boolean operator that returns True only if both conditions are true.
and
This Python statement allows you to handle exceptions and prevent crashes.
try-except
A concise way to create lists, sets, or dictionaries using loops and conditions.
Comprehension
The keyword used to manually trigger an exception.
raise
Python’s approach that executes code line-by-line without compilation.
Interpreted language
A method of simplifying nested loops by checking invalid cases first.
Inversion
(true or false) The for loop in Python executes a block of code repeatedly until a condition becomes False.
False → while loop executes until condition is false
(true or false) The break statement is used to skip the current iteration of a loop.
False → continue skips the current iteration
(true or false) n Python, keywords can be used as variable names.
False → Keywords cannot be used as variable names
(true or false) The try block is used to contain code that may raise an exception.
true
(true or false) A ZeroDivisionError occurs when an undefined variable is used.
False → That’s a NameError
The finally block executes only when no exception occurs.
False → finally executes regardless of errors
Using deeply nested loops improves readability and computing speed.
False → It reduces readability and speed
The keyword async is used for asynchronous programming in Python.
true
Python’s approach that executes code line-by-line without compilation.
true
The function int() converts a string into an integer value.
true