Python Basics Guide
1. Introduction to Python
Python is a high-level programming language known for its readability and versatility. It is widely
used in data science, web development, automation, and finance.
2. Basic Syntax and Variables
Python uses indentation instead of braces. Variables store data:
Example:
name = 'Alice'
age = 25
print(name, age)
3. Control Flow (Loops & Conditions)
Python supports if-else conditions and loops:
Example:
num = 10
if num > 5:
print('Big number')
else:
print('Small number')
4. Functions
Functions help organize reusable code:
def greet(name):
return 'Hello, ' + name
print(greet('Alice'))
5. Lists and Dictionaries
Lists store multiple values:
Python Basics Guide
fruits = ['Apple', 'Banana']
print(fruits[0])
Dictionaries store key-value pairs:
person = {'name': 'Alice', 'age': 25}
print(person['name'])
6. Using Libraries (NumPy, Pandas, Matplotlib)
Libraries add powerful functionality:
Install: pip install numpy pandas matplotlib
to work with data and visualization.
7. Working with CSV and Financial Data
Pandas helps with data handling:
import pandas as pd
df = pd.read_csv('data.csv')
print(df.head())
8. Next Steps
Practice Python exercises online (e.g., W3Schools), build small projects, and explore data analysis
with Pandas and yfinance.