Any2Quiz
Quizzes / CBSE / Class 10 / Computer Science / Programming with Python

Functions and Modules Quiz - CBSE Class 10 Computer Science

Free practice quiz: Functions and Modules (CBSE Class 10 Computer Science). 19 multiple-choice questions with answers and explanations. Play online, no sign-up needed.

This CBSE Class 10 Computer Science practice quiz has 19 multiple-choice questions on Functions and Modules, and 19 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: 19 questions, free

Sample questions

  1. What is the correct way to define a function in Python?

    Show answer

    Answer: C. def myFunc():

    In Python, functions are defined using the 'def' keyword followed by the function name and parentheses.

  2. What is a module in Python?

    Show answer

    Answer: A. A library of functions

    A module is a file containing Python definitions and statements, functioning as a library of functions and definitions.

  3. What returning type allows a function to return two values at once?

    Show answer

    Answer: B. tuple

    A function can return a tuple, allowing you to return multiple values at once.

  4. When are function annotations evaluated?

    Show answer

    Answer: A. During function definition

    Function annotations are evaluated at function definition time and stored in the function’s __annotations__ attribute.

  5. What is the output of 'print(math.pow(2, 3))' if the math module is imported?

    Show answer

    Answer: A. 8.0

    The 'pow' function in the math module returns a float. So, 'math.pow(2, 3)' will return 8.0.

Take the full quiz

More questions in this quiz

Answers and explanations are in the full quiz.

  1. Which of the following is used to exit a function?
  2. What is meant by a function parameter?
  3. Which keyword is used to include a module in a Python script?
  4. Which of the following statements can be used to call a function named myFunc with no parameters?
  5. How can default parameter values be specified in a function?
  6. What is a recursive function?
  7. Which of the following is NOT a built-in Python module?
  8. How do you check the version of Python being used, using a module?
  9. What is the correct syntax to use a module named 'math'?
  10. Which statement will output the current working directory using the os module?
  11. How can you alias a module name in Python?
  12. Which method can be used to iterate through every item in a module?
  13. Which statement is incorrect about functions in Python?
  14. Which of the following is an absolute import?

More quizzes

Browse all Programming with Python 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.