Class 10 Computer Science: Python Functions and Modules Worksheet

This worksheet assesses your understanding of Python functions, their definition, calling mechanisms, types of arguments, scope of variables, and the use of modules.

Class 10CBSEComputer SciencemediumPractice
Preview · 10 questions
  1. Q1. Which keyword is used to define a function in Python?
    • function
    • define
    • def
    • func
  2. Q2. Variables defined inside a function have a ______ scope, meaning they are only accessible within that function.
  3. Q3. What will be the output of the following Python code? def greet(name): print("Hello,", name) greet("Alice")
    • Hello, name
    • Hello, Alice
    • Error
    • None
  4. Q4. Explain the purpose of the 'return' statement in a Python function.
  5. Q5. Which of the following is an example of a built-in Python module?
    • my_module
    • math
    • calculator
    • user_defined

+ 5 more in the printable PDF.