0% found this document useful (0 votes)
47 views3 pages

Computer Science Revision Notes

The document provides revision notes for Class 12 Computer Science, focusing on Python fundamentals, data structures, and functions. It covers keywords, data types, input/output methods, conditional statements, loops, and various data structures like strings, lists, tuples, and dictionaries. Additionally, it discusses function basics, types of functions, variable scope, and includes extra tips for effective revision.

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)
47 views3 pages

Computer Science Revision Notes

The document provides revision notes for Class 12 Computer Science, focusing on Python fundamentals, data structures, and functions. It covers keywords, data types, input/output methods, conditional statements, loops, and various data structures like strings, lists, tuples, and dictionaries. Additionally, it discusses function basics, types of functions, variable scope, and includes extra tips for effective revision.

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

Class 12 Computer Science Revision Notes

1. REVISION TOUR 1: Basics of Python

Python Fundamentals:

- Keywords: if, else, for, def, etc.

- Identifiers: Names used for variables, functions, etc.

- Operators: Arithmetic, Relational, Logical, Assignment

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

Input/Output:

- input(): for user input

- print(): to display output

Conditional Statements:

if condition:

# statements

elif condition:

# statements

else:

# statements

Loops:

- For Loop: for i in range(5): print(i)

- While Loop: while condition: # statements

- Loop Control: break, continue, pass


2. REVISION TOUR 2: Python Data Structures

Strings:

- Immutable sequence of characters

- Slicing: s[1:4]

- Methods: lower(), upper(), find(), replace(), split(), join()

Lists:

- Mutable: lst = [1, 2, 3]; [Link](4); [Link](2)

Tuples:

- Immutable: t = (1, 2, 3)

Dictionaries:

- Key-value pairs: d = {'name': 'Haru', 'age': 17}; d['age'] = 18

3. WORKING WITH FUNCTIONS

Function Basics:

def greet():

print("Hello")

greet()

Function with Parameters:


def add(a, b):

return a + b

Types of Functions:

- Built-in: len(), max(), type()

- User-defined

- Recursive:

def factorial(n):

if n == 1:

return 1

else:

return n * factorial(n - 1)

Scope of Variables:

- Global: Declared outside all functions

- Local: Declared inside a function

Return Statement:

- Ends the function and sends back a value

Extra Tips:

- Practice writing simple programs.

- Revise short questions (MCQs or 1-mark).

- Go through previous year questions.

- Pay attention to Python syntax: spacing, colons, indentation.

You might also like