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

Python Programming 10 Pages

Uploaded by

tanshenmusic
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)
4 views10 pages

Python Programming 10 Pages

Uploaded by

tanshenmusic
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

Introduction to Python

Python is a high-level, interpreted programming language known for its simplicity and readability. It
is widely used in web development, data science, AI, and automation.
Variables and Data Types

Variables store data values. Common data types include int, float, string, and boolean. Python is
dynamically typed.
Operators

Operators are used to perform operations on variables. Types include arithmetic, relational, logical,
bitwise, and assignment operators.
Control Statements

Control statements like if, else, elif are used for decision making. They control the flow of execution
in a program.
Loops

Loops like for and while are used to repeat a block of code. Break and continue control loop
execution.
Functions

Functions are reusable blocks of code defined using def keyword. They can take parameters and
return values.
Lists, Tuples, Sets, Dictionary

Python provides built-in data structures: lists (mutable), tuples (immutable), sets (unique values),
dictionaries (key-value pairs).
File Handling

Python allows reading and writing files using open(), read(), write(), and close(). Modes include r, w,
a.
Exception Handling

Errors are handled using try, except, finally blocks. It prevents program crash and ensures smooth
execution.
Object Oriented Programming

OOP concepts include class, object, inheritance, encapsulation, and polymorphism. It helps in code
reusability.

You might also like