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

Class 12 Python 10 Pages Notes

The document provides an overview of Python programming basics, including its characteristics as a high-level, interpreted language. It covers data types, variables, operators, conditional statements, loops, functions, lists, tuples, dictionaries, and file and exception handling. Each section includes examples to illustrate the concepts.

Uploaded by

kingsss99909
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 views10 pages

Class 12 Python 10 Pages Notes

The document provides an overview of Python programming basics, including its characteristics as a high-level, interpreted language. It covers data types, variables, operators, conditional statements, loops, functions, lists, tuples, dictionaries, and file and exception handling. Each section includes examples to illustrate the concepts.

Uploaded by

kingsss99909
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

Page 1: Python Basics

Python is a high-level, interpreted programming language.

It is easy to learn and widely used.

Python is case-sensitive and uses indentation.

No semicolon is required.
Page 2: Data Types
int: Integer values like 10, -5

float: Decimal values like 3.14

str: Text data like 'Hello'

bool: True or False


Page 3: Variables
Variables store data values.

Example: x = 10

No need to declare type explicitly.


Page 4: Operators
Arithmetic: +, -, *, /, %, //, **

Comparison: ==, !=, >, <

Logical: and, or, not


Page 5: Conditional Statements
if, elif, else are used for decisions.

Example: if x > 0: print('Positive')


Page 6: Loops
for loop is used for iteration.

while loop runs until condition is true.


Page 7: Functions
Functions are reusable blocks.

Example: def add(a,b): return a+b


Page 8: Lists & Tuples
List: mutable, ordered collection.

Tuple: immutable, ordered collection.


Page 9: Dictionaries
Store data in key-value pairs.

Example: {'name':'Rahul'}
Page 10: File & Exception Handling
File handling: open, read, write files.

Exception: try-except to handle errors.

You might also like