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
What is the output of this code? def func(x, y=2): return x * y; print(func(3))
What is the result of this code? def func(x, y): return x - y; print(func(5, y=2))
What is a function that calls itself known as?
What is the output of this code? def f(x): if x == 1: return 1; else: return x + f(x - 1); print(f(3))
Which of the following is a correct way to pass keyword arguments to a function?
What is the default return value of a function that does not specify a return statement?
What is the output of this code? def greet(name="Guest"): print("Hello", name); greet()
What is the purpose of the *args parameter in a function?
What will be the output of this code? def func(x, y=10): return x + y; print(func(5, y=15))
Which of the following is true about recursion?