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

Class 12 CS Ch1 Python Revision Tour Notes-1

This document provides a comprehensive overview of Python basics, including its syntax, tokens, data types, and type conversion. It covers essential programming concepts such as input/output, conditional statements, loops, functions, and modules. The information serves as a revision guide for Class 12 Computer Science students learning Python.
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)
78 views2 pages

Class 12 CS Ch1 Python Revision Tour Notes-1

This document provides a comprehensive overview of Python basics, including its syntax, tokens, data types, and type conversion. It covers essential programming concepts such as input/output, conditional statements, loops, functions, and modules. The information serves as a revision guide for Class 12 Computer Science students learning Python.
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 - Chapter 1: Python Revision Tour

1. Python Basics

- Python is a high-level, interpreted, object-oriented language.

- It uses indentation instead of braces.

2. Python Tokens

a) Keywords: Reserved words like if, else, def, etc.

b) Identifiers: Names for variables/functions.

c) Literals: Constants like 10, 3.14, "hello", True.

d) Operators: +, -, *, /, //, %, ==, !=, and, or, etc.

e) Punctuators: Symbols like (), {}, :, .

3. Data Types

- int, float, bool, str, list, tuple, dict, set.

4. Type Conversion

- Implicit: auto conversion by Python.

- Explicit: using int(), float(), str(), etc.

5. Input/Output

- input(): takes user input (string).

- print(): prints output.

6. Conditional Statements

- if, elif, else blocks.


7. Loops

- for loop: for i in range(5)

- while loop: while condition

8. Loop Control

- break: exits loop.

- continue: skips iteration.

- pass: placeholder.

9. Functions

- def function_name(): defines a function.

- return: returns a value.

- Built-in: len(), max(), range(), etc.

10. Modules

- import math

- from math import sqrt

Use modules for reusable code.

You might also like