Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

Which keyword is used to define a function in Python?

View

What will be the output of the following code: def my_func(): return 5 + 10; print(my_func())?

View

How can you call a function in Python?

View

Which of the following statements is true about functions in Python?

View

What is the default return value of a function that does not explicitly return anything?

View

What will be the output of this code: def my_func(a, b): return a * b; print(my_func(2, 3))?

View

Which of the following is a valid function definition in Python?

View

What will be the output of the following code: def add(a=5, b=10): return a + b; print(add())?

View

What is the purpose of the return statement in a function?

View

What will be the result of this code: def hello(): print("Hello World!"); hello()?

View

Which keyword is used to define a function in Python?

def
function
func
lambda

What will be the output of the following code: def my_func(): return 5 + 10; print(my_func())?

5
10
15
Error

How can you call a function in Python?

call function_name
function_name()
function_name
function_name{}

Which of the following statements is true about functions in Python?

Functions cannot return a value
Functions must always accept arguments
Functions can be called multiple times
Functions do not require parentheses

What is the default return value of a function that does not explicitly return anything?

0
None
False
Error

What will be the output of this code: def my_func(a, b): return a * b; print(my_func(2, 3))?

5
6
Error
None

Which of the following is a valid function definition in Python?

def my_func:
def my_func():
def my_func{}:
function my_func():

What will be the output of the following code: def add(a=5, b=10): return a + b; print(add())?

10
15
20
Error

What is the purpose of the return statement in a function?

It defines the end of the function
It returns the function definition
It returns a value to the caller
It is used to pass arguments

What will be the result of this code: def hello(): print("Hello World!"); hello()?

Nothing
Error
Hello World!
None