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, freeSample questions
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.
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.
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.
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.
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.
More questions in this quiz
Answers and explanations are in the full quiz.
- Which of the following is used to exit a function?
- What is meant by a function parameter?
- Which keyword is used to include a module in a Python script?
- Which of the following statements can be used to call a function named myFunc with no parameters?
- How can default parameter values be specified in a function?
- What is a recursive function?
- Which of the following is NOT a built-in Python module?
- How do you check the version of Python being used, using a module?
- What is the correct syntax to use a module named 'math'?
- Which statement will output the current working directory using the os module?
- How can you alias a module name in Python?
- Which method can be used to iterate through every item in a module?
- Which statement is incorrect about functions in Python?
- Which of the following is an absolute import?
More quizzes
Browse all Programming with Python quizzes