0% found this document useful (0 votes)
23 views2 pages

CBSE Class 12 Functions Notes

The document provides an overview of functions in CBSE Class 12 Computer Science, covering their definition, advantages, and syntax. It discusses types of functions, the anatomy of functions, call by value vs call by reference, recursion, variable scope, practical examples, and common mistakes. Key concepts include built-in vs user-defined functions, parameters, return statements, and the importance of base conditions in recursion.

Uploaded by

raghul muthuvel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

CBSE Class 12 Functions Notes

The document provides an overview of functions in CBSE Class 12 Computer Science, covering their definition, advantages, and syntax. It discusses types of functions, the anatomy of functions, call by value vs call by reference, recursion, variable scope, practical examples, and common mistakes. Key concepts include built-in vs user-defined functions, parameters, return statements, and the importance of base conditions in recursion.

Uploaded by

raghul muthuvel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Working with Functions - CBSE Class 12 Computer Science

Introduction to Functions

- Definition and advantages: modularity, reuse, improved readability.

- Syntax: def functionName(parameters): in languages like Python.

Types of Functions

- Built-in functions vs user-defined functions.

- Parameter types:

- No parameters, no return.

- Parameters with/without return values.

Function Anatomy

- Parameters vs arguments.

- Return statement and its significance.

Call by Value vs Call by Reference

- Differences in how values and references are passed.

- Examples with lists (mutable) and integers (immutable) in Python.

Recursion

- Definition and use cases such as factorial, Fibonacci.

- Base condition to avoid infinite recursion.

Scope of Variables

- Local vs global variables.

- Use and effect of global keyword.

Practical Examples

- Function to calculate factorial.

- Checking prime numbers.


Working with Functions - CBSE Class 12 Computer Science

- Swapping values using a function.

- Recursion in action.

Common Mistakes

- Forgetting to use return values.

- Improper indentation.

- Missing base conditions in recursion.

- Misunderstanding variable scopes.

You might also like