Any2Quiz
Quizzes / CBSE / Class 11 / Computer Science / Programming and Computational Thinking

Functions in Python Quiz - CBSE Class 11 Computer Science

Free practice quiz: Functions in Python (CBSE Class 11 Computer Science). 20 multiple-choice questions with answers and explanations. Play online, no sign-up needed.

This CBSE Class 11 Computer Science practice quiz has 20 multiple-choice questions on Functions in Python, and 20 of them come with an explanation. Try the 5 sample questions below (tap an option to check yourself), then play the full quiz online. No sign-up needed.

Start quiz: 20 questions, free

Sample questions

  1. What is a function in Python?

    Show answer

    Answer: A. A block of code that performs a specific task

    A function is a reusable block of code designed to perform a specific task.

  2. What is a function parameter?

    Show answer

    Answer: C. A variable in the function definition that receives an argument

    Parameters act as placeholders for the arguments passed during function call.

  3. What happens if a recursive function lacks a base case?

    Show answer

    Answer: D. The program enters an infinite loop

    Without a base case, the function will call itself repeatedly without stopping.

  4. How can you access a global variable from inside a function?

    Show answer

    Answer: D. By using the 'global' keyword before accessing the variable

    Using the 'global' keyword explicitly indicates that you want to modify the global variable.

  5. What is the difference between *args and **kwargs?

    Show answer

    Answer: B. *args accepts a variable number of positional arguments, **kwargs accepts a variable number of keyword arguments

    They are used to handle flexible function signatures.

Take the full quiz

More questions in this quiz

Answers and explanations are in the full quiz.

  1. How do you define a function in Python?
  2. What is the purpose of the 'return' statement in a Python function?
  3. What are arguments in a Python function?
  4. What is the difference between a function's parameters and arguments?
  5. What is a recursive function?
  6. What is the base case in a recursive function?
  7. Explain the concept of function scope in Python.
  8. What is a local variable in Python?
  9. What is a global variable in Python?
  10. What are default arguments in Python functions?
  11. What is the purpose of keyword arguments in Python?
  12. Explain the concept of variable-length arguments (*args and **kwargs) in Python functions.
  13. Describe a scenario where using lambda functions in Python would be beneficial.
  14. How do you define an anonymous function (lambda function) in Python?
  15. Explain higher-order functions in Python and provide an example using map or filter.

More quizzes

Browse all Programming and Computational Thinking quizzes

More to play

Daily ChallengeA new quiz every day. Keep your streak.HangmanGuess the word, letter by letter.Story QuestLearn through short interactive stories.All quizzesCBSE, ICSE, competitive exams and more.