Class 10 Computer Science: Python Functions and Modules Worksheet

Answer key included

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 Sciencemedium

Your device's Print screen will open — choose "Save as PDF" to download.

Track practice: print a star chart

Class 10 · Computer Science
Name: ____________
  1. Q1.Which keyword is used to define a function in Python?
    • A.function
    • B.define
    • C.def
    • D.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")
    • A.Hello, name
    • B.Hello, Alice
    • C.Error
    • D.None
  4. Q4.Explain the purpose of the 'return' statement in a Python function.

Preview — full sheet in the PDF

What's inside this workbook

This Class 10 Computer Science Practice contains 10 questions across 2 printable pages and includes a full answer key at medium difficulty. Aligned to the CBSE and NCERT syllabus.

How this worksheet helps your child

  • Builds confidence in core Computer Science concepts taught in Class 10 through repeated, varied practice.
  • Aligned to CBSE and NCERT — questions mirror the pattern children see in school tests and unit assessments.
  • Comes with an answer key so parents and students can self-check in minutes, without needing a teacher.
  • Pitched at medium level — use it for daily homework, weekend revision or quick exam warm-ups.

About this worksheet

This helpful practice worksheet for Class 10 Computer Science students focuses on mastering Python functions and modules. Understanding functions is a cornerstone of efficient programming, as it allows us to break down complex tasks into smaller, manageable parts. Modules, on the other hand, provide ready-to-use code, making programming faster and less error-prone. This topic is crucial for Class 10 students following the CBSE curriculum, as it lays the foundation for more advanced programming concepts and prepares them for real-world application development. This worksheet is ideal for students looking to reinforce their knowledge, practice defining and calling functions, understand different argument types, explore variable scope, and effectively use Python modules. It's a valuable resource for anyone aiming for a strong grasp of Python programming principles.

What your child will learn

  • Identify and define Python functions correctly.
  • Practice calling functions with various types of arguments.
  • Recognise the scope of variables within functions and modules.
  • Apply built-in and user-defined modules effectively in Python programs.
  • Solve problems requiring the use of functions to modularise code.

Understanding the concept

In computer programming, a 'function' is like a mini-program or a recipe for a specific task. Imagine you want to bake a cake. Instead of writing all the steps every time you bake, you can just say 'bake a cake,' and everyone knows it involves mixing ingredients, baking, and decorating. Similarly, in Python, a function groups together a set of instructions that perform a particular job. You give the function a name, and whenever you need that job done, you just 'call' its name. For example, a function could be named `calculate_area` which takes the length and width of a rectangle (these are called 'arguments' or 'inputs') and returns the area. This makes your code neat, reusable, and easier to understand. 'Modules' are like collections of these functions and other code, all related to a specific topic. Think of a cookbook filled with different recipes (functions). The entire cookbook is like a module. Python comes with many built-in modules, and you can also create your own. When you 'import' a module, you bring all its useful functions into your program, saving you from writing them from scratch. This concept of using functions and modules is fundamental to writing efficient and organised programs in Python.

Tips for parents & teachers

  • Encourage your child to first review their textbook notes on functions, arguments, scope, and modules before attempting the worksheet.
  • Suggest they try to write down simple Python code examples for each concept they are unsure about as they work through the problems.
  • Help your child understand variable scope by using a visual analogy, like a 'private room' (local scope) versus a 'shared house' (global scope).
  • After completing, discuss any questions they found challenging and review the correct answers and reasoning together.
  • Reinforce learning by asking them to think of real-world scenarios where breaking tasks into functions would be beneficial.

Topics covered

pythonfunctionsmodulesscopeargumentscbseclass 10computer science

How to use this worksheet at home

Open the print view and use your browser's Print dialog to print on regular A4 paper or save as a PDF. Hand the printed sheet to your child (Class 10) and set a relaxed time limit — 15 to 25 minutes works for most Computer Science worksheets. When they're done, open the "With answer key" view and let them self-mark question by question. Re-print as many times as you need; the file never expires and there's no download limit.

Frequently asked questions

Is this Computer Science worksheet really free?
Yes — every workbook on WorkbookWala is 100% free to download and print. No login, no email, no paywall. We're free for students, parents and teachers.
Is it aligned to the CBSE / NCERT syllabus?
Yes. All Class 10 worksheets are built around the CBSE and NCERT pattern so they map cleanly to what your child is studying in school.
Can I print this worksheet at home?
Yes. Click "Open print view" and use your browser's Print dialog to print on standard A4 paper, or save it as a PDF for later. The layout is designed to fit cleanly without scaling.
Does it include an answer key?
Yes — click "With answer key" to print a version with answers included, so parents and students can self-mark in minutes.

More Computer Science worksheets for Class 10

View all →
Something off with this worksheet? Report an issue
Print / Save as PDF