Python
Python
Content
• What is python.
• Features of python.
• Variables and data types.
• Variable rules.
• Python operator.
• Python conditions.
• Python Loops.
• Python Libraries.
What is Python?
• Python is a popular, high-level programming
language.
• Created by Guido van Rossum
• It support Object Oriented Programming
Language
• It is used to build websites and software, and
analyze data
Key Features of Python
• Interpreted language
• Easy to learn
• Object-Oriented
• Open Source
• Dynamically typed
• Portable
Python Variables and Data Types
• Variables: Used to store data values.
• Data Types: int, float, str, list, tuple, dict, etc.
• Example: x = 10, name = 'Alice'.
Variable rules
• A variable name can contain alphabets, digits
and underscores.
• A variable name can only start with an
alphabet and underscore.
• A variable name can’t start with a digit
• No white space is allowed to be used inside a
variable name
Python Operators
• Arithmetic Operators: +, -, *, /, %.
• Comparison Operators: ==, !=, >, <, >=, <=.
• Logical Operators: and, or, not.
Python Conditionals
• Use if, if else, elif, nested if else for decision-
making.
• Example:
if x > 5:
print('x is greater than 5’)
else:
print('x is 5 or less').
Python Loops
• For loop: Iterates over a sequence (list, tuple,
etc.).
• While loop: Repeats as long as a condition is
true.
• Example:
for i in range(5):
print(i)
Advanced Python Libraries
• NumPy: Library for numerical computations.
• Pandas: Used for data manipulation and
analysis.
• Matplotlib: Visualization library for creating
plots and graphs.
Best Practices in Python
• Write clean, readable code.
• Use meaningful variable names.
• Comment your code to explain logic.
• Use built in function and libraries.
THANK YOU