1.
Introduction to Python
Python is a high-level, interpreted, object-oriented programming language known for its
simplicity and readability.
It was created by Guido van Rossum and first released in 1991.
Why Python is Popular
Easy to learn
Simple syntax
Large community support
Extensive libraries
Cross-platform compatibility
Used in AI, web development, data science, automation
2. Features of Python
Interpreted language
Dynamically typed
Object-oriented
Open-source
Portable
Extensive standard library
3. Applications of Python
Python is used in:
Web development
Data science
Machine learning
Artificial intelligence
Game development
Automation
Cybersecurity
Popular companies using Python:
Google
Netflix
Instagram
4. Installing Python
Official website:
Python
You can use:
Command line
IDLE
VS Code
Jupyter Notebook
5. Basic Syntax
Python uses indentation instead of braces.
Example:
print("Hello, World!")
6. Variables in Python
Variables store data.
Example:
x = 10
name = "John"
price = 99.5
No need to declare data type.
7. Data Types in Python
7.1 Numeric Types
int
float
complex
7.2 Text Type
str
7.3 Sequence Types
list
tuple
range
7.4 Set Type
set
7.5 Mapping Type
dict
8. Type Conversion
x = int("10")
y = float(5)
z = str(100)
9. Operators in Python
Arithmetic Operators
o (Addition)
o (Subtraction)
o (Multiplication)
/ (Division)
% (Modulus)
** (Exponentiation)
Comparison Operators
==
!=
<
=
<=
Logical Operators
and
or
not
10. Conditional Statements
if Statement
if x > 0:
print("Positive")
if-else
if x > 0:
print("Positive")
else:
print("Negative")
if-elif-else
if x > 0:
print("Positive")
elif x == 0:
print("Zero")
else:
print("Negative")