What is the symbol used to represent comments in Python?
What is the hash (#) symbol?
What is the syntax for an if statement in Python?
if condition:
What is the syntax for defining a function in Python?
def functionName(parameters):
What is the definition of the imperative programming paradigm?
The imperative programming paradigm is a programming style that focuses on describing "how" a program should perform a task.
What is the functional programming paradigm?
What is a programming paradigm that emphasizes the use of pure functions and avoids shared state and mutable data?
What is the difference between "==" and "=" in Python?
"==" is a comparison operator used to check if two values are equal, while "=" is an assignment operator used to assign a value to a variable.
What is the syntax for a for loop in Python?
for item in iterable:
What is the difference between arguments and parameters in Python?
Arguments are the values passed to a function when it is called, while parameters are the placeholders used in the function definition.
What are some common examples of imperative programming statements in Python?
Some common examples of imperative programming statements in Python include variable assignments, conditional statements (if/else), loops (for/while), and function calls.
What are some of the advantages of functional programming?
Some of the advantages of functional programming include better modularity, easier testing and debugging, and better scalability.
What is the syntax for printing "Hello, World!" to the console in Python?
print("Hello, World!")
What is the syntax for a while loop in Python?
while condition:
What is the syntax for returning a value from a function in Python?
return value
What is the difference between imperative and declarative programming?
What is declarative programming focuses on "what" a program should do, while imperative programming focuses on "how" a program should perform a task.
What is the name of the Python library used for functional programming that provides a collection of immutable data structures, such as lists, tuples, and dictionaries?
What is the collections module in Python?
What is the syntax for creating a list in Python?
myList = [1, 2, 3, 4, 5]
What is the purpose of the break statement in Python?
The break statement is used to exit a loop prematurely.
What is the purpose of a docstring in a Python function?
A docstring is used to provide documentation for a function, and can be accessed using the help() function.
What is the syntax for a variable assignment in Python?
What is variable_name = value?
What is a higher-order function?
What is a function that takes one or more functions as arguments, and/or returns a function as its result?
What is the syntax for creating a dictionary in Python?
myDict = {"key1": "value1", "key2": "value2", "key3": "value3"}
What is the purpose of the continue statement in Python?
The continue statement is used to skip to the next iteration of a loop.
What is a lambda function in Python?
A lambda function is a small, anonymous function that can be defined in one line of code. It is often used as a shortcut for simple tasks. The syntax for a lambda function is lambda arguments: expression.
What is the syntax for an if-else statement in Python?
if condition:
code to execute if condition is true
else:
code to execute if condition is false
What is a lambda function?
What is an anonymous function that can be defined in one line of code, and is often used for simple operations such as filtering or transforming data?