Complete the code to define a function named greet.
def [1](): print("Hello!")
The function name should be greet as specified.
Complete the code to define a function that takes one parameter named name.
def greet([1]): print(f"Hello, {name}!")
The parameter should be named name to match the print statement.
Fix the error in the function definition by completing the code.
def add_numbers(a, b[1]: return a + b
The function parameters must be enclosed in parentheses. The missing closing parenthesis ) fixes the syntax error.
Fill both blanks to define a function named multiply that returns the product of two parameters x and y.
def [1]([2], y): return x * y
The function name should be multiply and the first parameter should be x to match the return statement.
Fill all three blanks to define a function named is_even that returns True if a number n is even, otherwise False.
def [1]([2]): if n [3] 2 == 0: return True else: return False
The function name is is_even, the parameter is n, and the modulo operator % checks if the number is divisible by 2.