Python Cheatsheet ♥️
1. Common Data Types
int, float – numbers
str – text
list – ordered, changeable collection
dict – key-value pairs
tuple – like list, but unchangeable
set – unique, unordered items
2. Essential Functions
print() – display output
type() – check data type
len() – count items
range() – generate numbers
input() – take user input
3. String Methods
.upper(), .lower() – change case
.strip() – remove whitespace
.replace() – swap text
.split() – break into list
4. List Methods
append() – add item
pop() – remove item
sort() – sort list
[1:4] – slicing (get part of list)
5. Dictionary Basics
Access: mydict['key']
Safe access: mydict.get('key')
Add/Update: mydict['new'] = value
6. Control Flow
if / elif / else – conditions
for – loop over items
while – loop with condition
break / continue – control loop
7. Functions
def – define a function
return – return a value
lambda – short anonymous function
8. Useful Built-in Modules
math – sqrt, pi, round
random – random numbers, choices
datetime – current date/time
os – system & file handling
9. Popular Libraries for Data Work
NumPy – numerical operations
Pandas – dataframes and analysis
Matplotlib
React with ❤️ for more useful Cheatsheets
#python
1. Common Data Types
int, float – numbers
str – text
list – ordered, changeable collection
dict – key-value pairs
tuple – like list, but unchangeable
set – unique, unordered items
2. Essential Functions
print() – display output
type() – check data type
len() – count items
range() – generate numbers
input() – take user input
3. String Methods
.upper(), .lower() – change case
.strip() – remove whitespace
.replace() – swap text
.split() – break into list
4. List Methods
append() – add item
pop() – remove item
sort() – sort list
[1:4] – slicing (get part of list)
5. Dictionary Basics
Access: mydict['key']
Safe access: mydict.get('key')
Add/Update: mydict['new'] = value
6. Control Flow
if / elif / else – conditions
for – loop over items
while – loop with condition
break / continue – control loop
7. Functions
def – define a function
return – return a value
lambda – short anonymous function
8. Useful Built-in Modules
math – sqrt, pi, round
random – random numbers, choices
datetime – current date/time
os – system & file handling
9. Popular Libraries for Data Work
NumPy – numerical operations
Pandas – dataframes and analysis
Matplotlib
React with ❤️ for more useful Cheatsheets
#python
❤4
10 Python Concepts Every Developer Should Know
✅ List Comprehensions – Write cleaner loops in a single line
✅ Lambda Functions – Anonymous functions for quick operations
✅ Decorators – Add functionality to functions without changing them
✅ Generators & Iterators – Handle large data efficiently with lazy evaluation
✅ OOP (Classes & Inheritance) – Build scalable, reusable code
✅ Exception Handling – Write error-proof programs with try-except blocks
✅ Modules & Packages – Organize your code like a pro
✅ Virtual Environments (venv) – Keep dependencies isolated per project
✅ File Handling (with open) – Read/write files securely
✅ Type Hinting – Make your code more readable and less error-prone
Free Python Resources: 👇 https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L
✅ List Comprehensions – Write cleaner loops in a single line
✅ Lambda Functions – Anonymous functions for quick operations
✅ Decorators – Add functionality to functions without changing them
✅ Generators & Iterators – Handle large data efficiently with lazy evaluation
✅ OOP (Classes & Inheritance) – Build scalable, reusable code
✅ Exception Handling – Write error-proof programs with try-except blocks
✅ Modules & Packages – Organize your code like a pro
✅ Virtual Environments (venv) – Keep dependencies isolated per project
✅ File Handling (with open) – Read/write files securely
✅ Type Hinting – Make your code more readable and less error-prone
Free Python Resources: 👇 https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L
👍4
How to convert image to pdf in Python
# Python3 program to convert image to pfd
# using img2pdf library
# importing necessary libraries
import img2pdf
from PIL import Image
import os
# storing image path
img_path = "Input.png"
# storing pdf path
pdf_path = "file_pdf.pdf"
# opening image
image = Image.open(img_path)
# converting into chunks using img2pdf
pdf_bytes = img2pdf.convert(image.filename)
# opening or creating pdf file
file = open(pdf_path, "wb")
# writing pdf files with chunks
file.write(pdf_bytes)
# closing image file
image.close()
# closing pdf file
file.close()
# output
print("Successfully made pdf file")
pip3 install pillow && pip3 install img2pdf
👍6👏2❤1
There were a bunch of new methods added to thr Set interface in JavaScript, and here are all of them!
✨ Sets represent a collection of unordered items, and are optimised to quickly find if a particular item exists in a collection or not.
These methods help to reduce a lot of boilerplate code which would be required otherwise!
✨ Sets represent a collection of unordered items, and are optimised to quickly find if a particular item exists in a collection or not.
These methods help to reduce a lot of boilerplate code which would be required otherwise!
👍4
Top 10 Python Concepts
Variables & Data Types
Understand integers, floats, strings, booleans, lists, tuples, sets, and dictionaries.
Control Flow (if, else, elif)
Write logic-based programs using conditional statements.
Loops (for & while)
Automate tasks and iterate over data efficiently.
Functions
Build reusable code blocks with def, understand parameters, return values, and scope.
List Comprehensions
Create and transform lists concisely:
[x*2 for x in range(10) if x % 2 == 0]
Modules & Packages
Import built-in, third-party, or custom modules to structure your code.
Exception Handling
Handle errors using try, except, finally for robust programs.
Object-Oriented Programming (OOP)
Learn classes, objects, inheritance, encapsulation, and polymorphism.
File Handling
Open, read, write, and manage files using open(), read(), write().
Working with Libraries
Use powerful libraries like:
- NumPy for numerical operations
- Pandas for data analysis
- Matplotlib/Seaborn for visualization
- Requests for API calls
- JSON for data parsing
#python
Variables & Data Types
Understand integers, floats, strings, booleans, lists, tuples, sets, and dictionaries.
Control Flow (if, else, elif)
Write logic-based programs using conditional statements.
Loops (for & while)
Automate tasks and iterate over data efficiently.
Functions
Build reusable code blocks with def, understand parameters, return values, and scope.
List Comprehensions
Create and transform lists concisely:
[x*2 for x in range(10) if x % 2 == 0]
Modules & Packages
Import built-in, third-party, or custom modules to structure your code.
Exception Handling
Handle errors using try, except, finally for robust programs.
Object-Oriented Programming (OOP)
Learn classes, objects, inheritance, encapsulation, and polymorphism.
File Handling
Open, read, write, and manage files using open(), read(), write().
Working with Libraries
Use powerful libraries like:
- NumPy for numerical operations
- Pandas for data analysis
- Matplotlib/Seaborn for visualization
- Requests for API calls
- JSON for data parsing
#python
👍7❤1
𝗛𝗼𝘄 𝘁𝗼 𝗟𝗲𝗮𝗿𝗻 𝗣𝘆𝘁𝗵𝗼𝗻 𝗙𝗮𝘀𝘁 (𝗘𝘃𝗲𝗻 𝗜𝗳 𝗬𝗼𝘂'𝘃𝗲 𝗡𝗲𝘃𝗲𝗿 𝗖𝗼𝗱𝗲𝗱 𝗕𝗲𝗳𝗼𝗿𝗲!)🐍🚀
Python is everywhere—web dev, data science, automation, AI…
But where should YOU start if you're a beginner?
Don’t worry. Here’s a 6-step roadmap to master Python the smart way (no fluff, just action)👇
🔹 𝗦𝘁𝗲𝗽 𝟭: Learn the Basics (Don’t Skip This!)
✅ Variables, data types (int, float, string, bool)
✅ Loops (for, while), conditionals (if/else)
✅ Functions and user input
Start with:
Python.org Docs
YouTube: Programming with Mosh / CodeWithHarry
Platforms: W3Schools / SoloLearn / FreeCodeCamp
Spend a week here.
Practice > Theory.
🔹 𝗦𝘁𝗲𝗽 𝟮: Automate Boring Stuff (It’s Fun + Useful!)
✅ Rename files in bulk
✅ Auto-fill forms
✅ Web scraping with BeautifulSoup or Selenium
Read: “Automate the Boring Stuff with Python”
It’s beginner-friendly and practical!
🔹 𝗦𝘁𝗲𝗽 𝟯: Build Mini Projects (Your Confidence Booster)
✅ Calculator app
✅ Dice roll simulator
✅ Password generator
✅ Number guessing game
These small projects teach logic, problem-solving, and syntax in action.
🔹 𝗦𝘁𝗲𝗽 𝟰: Dive Into Libraries (Python’s Superpower)
✅ Pandas and NumPy – for data
✅ Matplotlib – for visualizations
✅ Requests – for APIs
✅ Tkinter – for GUI apps
✅ Flask – for web apps
Libraries are what make Python powerful. Learn one at a time with a mini project.
🔹 𝗦𝘁𝗲𝗽 𝟱: Use Git + GitHub (Be a Real Dev)
✅ Track your code with Git
✅ Upload projects to GitHub
✅ Write clear README files
✅ Contribute to open source repos
Your GitHub profile = Your online CV. Keep it active!
🔹 𝗦𝘁𝗲𝗽 𝟲: Build a Capstone Project (Level-Up!)
✅ A weather dashboard (API + Flask)
✅ A personal expense tracker
✅ A web scraper that sends email alerts
✅ A basic portfolio website in Python + Flask
Pick something that solves a real problem—bonus if it helps you in daily life!
🎯 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴 𝗣𝘆𝘁𝗵𝗼𝗻 = 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴 𝗣𝗼𝘄𝗲𝗿𝗳𝘂𝗹 𝗣𝗿𝗼𝗯𝗹𝗲𝗺 𝗦𝗼𝗹𝘃𝗶𝗻𝗴
You don’t need to memorize code. Understand the logic.
Google is your best friend. Practice is your real teacher.
Python Resources: https://whatsapp.com/channel/0029Vau5fZECsU9HJFLacm2a
ENJOY LEARNING 👍👍
Python is everywhere—web dev, data science, automation, AI…
But where should YOU start if you're a beginner?
Don’t worry. Here’s a 6-step roadmap to master Python the smart way (no fluff, just action)👇
🔹 𝗦𝘁𝗲𝗽 𝟭: Learn the Basics (Don’t Skip This!)
✅ Variables, data types (int, float, string, bool)
✅ Loops (for, while), conditionals (if/else)
✅ Functions and user input
Start with:
Python.org Docs
YouTube: Programming with Mosh / CodeWithHarry
Platforms: W3Schools / SoloLearn / FreeCodeCamp
Spend a week here.
Practice > Theory.
🔹 𝗦𝘁𝗲𝗽 𝟮: Automate Boring Stuff (It’s Fun + Useful!)
✅ Rename files in bulk
✅ Auto-fill forms
✅ Web scraping with BeautifulSoup or Selenium
Read: “Automate the Boring Stuff with Python”
It’s beginner-friendly and practical!
🔹 𝗦𝘁𝗲𝗽 𝟯: Build Mini Projects (Your Confidence Booster)
✅ Calculator app
✅ Dice roll simulator
✅ Password generator
✅ Number guessing game
These small projects teach logic, problem-solving, and syntax in action.
🔹 𝗦𝘁𝗲𝗽 𝟰: Dive Into Libraries (Python’s Superpower)
✅ Pandas and NumPy – for data
✅ Matplotlib – for visualizations
✅ Requests – for APIs
✅ Tkinter – for GUI apps
✅ Flask – for web apps
Libraries are what make Python powerful. Learn one at a time with a mini project.
🔹 𝗦𝘁𝗲𝗽 𝟱: Use Git + GitHub (Be a Real Dev)
✅ Track your code with Git
✅ Upload projects to GitHub
✅ Write clear README files
✅ Contribute to open source repos
Your GitHub profile = Your online CV. Keep it active!
🔹 𝗦𝘁𝗲𝗽 𝟲: Build a Capstone Project (Level-Up!)
✅ A weather dashboard (API + Flask)
✅ A personal expense tracker
✅ A web scraper that sends email alerts
✅ A basic portfolio website in Python + Flask
Pick something that solves a real problem—bonus if it helps you in daily life!
🎯 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴 𝗣𝘆𝘁𝗵𝗼𝗻 = 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴 𝗣𝗼𝘄𝗲𝗿𝗳𝘂𝗹 𝗣𝗿𝗼𝗯𝗹𝗲𝗺 𝗦𝗼𝗹𝘃𝗶𝗻𝗴
You don’t need to memorize code. Understand the logic.
Google is your best friend. Practice is your real teacher.
Python Resources: https://whatsapp.com/channel/0029Vau5fZECsU9HJFLacm2a
ENJOY LEARNING 👍👍
👍4❤1
I’ve never met an awesome software developer who:
- Thought learning new frameworks was a waste.
- Avoided refactoring because “it already works.”
- Avoided debugging because it was frustrating.
- Never deleted code they once proudly wrote.
- Never pushed code that broke in production.
- Stuck to one programming language forever.
- Stopped learning after getting their first job.
- Didn’t rewrite their code later.
- Only worked on projects that felt safe.
- Refused to ask questions when stuck.
Great developers aren’t perfect.
They take risks.
They make mistakes.
They debug endlessly.
They make wrong estimates.
But during all that, They learn.
And that’s exactly why they grow.
Keep that in mind
- Thought learning new frameworks was a waste.
- Avoided refactoring because “it already works.”
- Avoided debugging because it was frustrating.
- Never deleted code they once proudly wrote.
- Never pushed code that broke in production.
- Stuck to one programming language forever.
- Stopped learning after getting their first job.
- Didn’t rewrite their code later.
- Only worked on projects that felt safe.
- Refused to ask questions when stuck.
Great developers aren’t perfect.
They take risks.
They make mistakes.
They debug endlessly.
They make wrong estimates.
But during all that, They learn.
And that’s exactly why they grow.
Keep that in mind
👍7❤3👏2🫡2
🔰 C++ Roadmap for Beginners 2025
├── 🧠 Introduction to C++ & How It Works
├── 🧰 Setting Up Environment (IDE, Compiler)
├── 📝 Basic Syntax & Structure
├── 🔢 Variables, Data Types & Constants
├── ➕ Operators (Arithmetic, Relational, Logical, Bitwise)
├── 🔁 Flow Control (if, else, switch)
├── 🔄 Loops (for, while, do...while)
├── 🧩 Functions (Declaration, Definition, Recursion)
├── 📦 Arrays, Strings & Vectors
├── 🧱 Pointers & References
├── 🧮 Dynamic Memory Allocation (new, delete)
├── 🏗 Structures & Unions
├── 🏛 Object-Oriented Programming (Classes, Objects, Inheritance, Polymorphism)
├── 📂 File Handling in C++
├── ⚠️ Exception Handling
├── 🧠 STL (Standard Template Library - vector, map, set, etc.)
├── 🧪 Mini Projects (Bank System, Student Record, etc.)
Like for the detailed explanation ❤️
#c #programming
├── 🧠 Introduction to C++ & How It Works
├── 🧰 Setting Up Environment (IDE, Compiler)
├── 📝 Basic Syntax & Structure
├── 🔢 Variables, Data Types & Constants
├── ➕ Operators (Arithmetic, Relational, Logical, Bitwise)
├── 🔁 Flow Control (if, else, switch)
├── 🔄 Loops (for, while, do...while)
├── 🧩 Functions (Declaration, Definition, Recursion)
├── 📦 Arrays, Strings & Vectors
├── 🧱 Pointers & References
├── 🧮 Dynamic Memory Allocation (new, delete)
├── 🏗 Structures & Unions
├── 🏛 Object-Oriented Programming (Classes, Objects, Inheritance, Polymorphism)
├── 📂 File Handling in C++
├── ⚠️ Exception Handling
├── 🧠 STL (Standard Template Library - vector, map, set, etc.)
├── 🧪 Mini Projects (Bank System, Student Record, etc.)
Like for the detailed explanation ❤️
#c #programming
❤5👍5
🔰 R Programming Roadmap for Beginners 2025
├── 🧠 What is R? Why Use It in Data Science?
├── 🖥️ Installing R & RStudio
├── 🔤 Data Types & Variables in R
├── 🔄 Control Structures (if, else, loops)
├── 🧮 Functions in R
├── 📊 Data Frames, Lists, Vectors, Matrices
├── 📂 Reading Data (CSV, Excel, Web)
├── 🧹 Data Cleaning with dplyr
├── 📈 Data Visualization with ggplot2
├── 🧠 Basic Statistics in R
├── 📦 Working with Tidyverse
├── 🔁 Writing Custom Functions & Scripts
├── ⚙️ R Markdown & Report Generation
├── 🧪 R Projects:
│ ├── Covid-19 Data Tracker
│ ├── Movie Ratings Visualizer
│ ├── Sales Dashboard using shiny
#Programming
├── 🧠 What is R? Why Use It in Data Science?
├── 🖥️ Installing R & RStudio
├── 🔤 Data Types & Variables in R
├── 🔄 Control Structures (if, else, loops)
├── 🧮 Functions in R
├── 📊 Data Frames, Lists, Vectors, Matrices
├── 📂 Reading Data (CSV, Excel, Web)
├── 🧹 Data Cleaning with dplyr
├── 📈 Data Visualization with ggplot2
├── 🧠 Basic Statistics in R
├── 📦 Working with Tidyverse
├── 🔁 Writing Custom Functions & Scripts
├── ⚙️ R Markdown & Report Generation
├── 🧪 R Projects:
│ ├── Covid-19 Data Tracker
│ ├── Movie Ratings Visualizer
│ ├── Sales Dashboard using shiny
#Programming
❤1👍1
Built-in Data Types in Python 👆
👍3🥰2❤1