DS 29043 Weekend Quiz

Dear Learners,

Challenge yourself with this short Python quiz and test your knowledge! Sharpen your coding skills and have fun while learning. Take a break from your weekend activities, embrace the joy of problem-solving, and see how much you know about Python. Good luck and enjoy the quiz!

Question 1: What is the keyword used to define a function in Python?
A) func
B) def
C) fun
D) define

Question 2: What is the purpose of the return statement in a function?
A) It terminates the execution of the function.
B) It defines the input parameters of the function.
C) It specifies the data type of the function.
D) It specifies the value to be outputted by the function.

Question 3: Which of the following is true about function arguments in Python?
A) Python functions cannot accept arguments.
B) Function arguments in Python must always have default values.
C) Python functions can accept both required and optional arguments.
D) Python functions can only accept a fixed number of arguments.

3 Likes
  1. def
  2. A) It terminates the execution of the function.
    D) It specifies the value to be outputted by the function.
  3. C) Python functions can accept both required and optional arguments.
2 Likes

1. B) def
2. D) It specifies the value to be outputted by the function.
3. C) Python functions can accept both required and optional arguments.

1 Like