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

Class12 CS Revision Functions

This revision sheet covers key topics in Class 12 Computer Science, focusing on Python data types, control structures, operators, and methods for lists and dictionaries. It also details function syntax, types of functions, parameters, scope, and recursion. Sample practice questions are provided to reinforce understanding of these concepts.

Uploaded by

haruvijay4
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)
5 views2 pages

Class12 CS Revision Functions

This revision sheet covers key topics in Class 12 Computer Science, focusing on Python data types, control structures, operators, and methods for lists and dictionaries. It also details function syntax, types of functions, parameters, scope, and recursion. Sample practice questions are provided to reinforce understanding of these concepts.

Uploaded by

haruvijay4
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
You are on page 1/ 2

Class 12 Computer Science: Revision Sheet

Topics: Revision Tour 1 & 2, Working with Functions

Revision Tour 1 & 2 - Python Recap

- Data Types: int, float, str, list, tuple, set, dict

- Control Structures: if-elif-else, loops (for, while)

- Operators: Arithmetic (+, -, *, /), Logical (and, or, not), Membership (in, not in)

- List Methods: append(), insert(), remove(), sort()

- Dictionary Methods: keys(), values(), items(), get(), update()

- Input/output: input(), print(), type casting

Working with Functions

- Function Syntax: def func_name(parameters):

- Types:

* No argument, no return

* With argument, no return

* With argument and return

- Parameters vs Arguments

- Default and Keyword Arguments

- Scope: Local vs Global variables

- Return statement: ends function execution and sends value back

- Use of recursion (if in syllabus)

Examples:

1. def add(a, b): return a + b

2. def greet(name="Student"): print("Hello", name)


Sample Practice Questions

1. Predict the output of the following:

def test(x):

x=x+2

return x

print(test(5))

2. Write a function to check if a number is prime.

3. What is the difference between local and global variables?

4. Define a function with default arguments.

5. Write a function to count vowels in a string.

You might also like