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
👍1
If I wanted to get my opportunity to interview at Google or Amazon for SDE roles in the next 6-8 months…
Here’s exactly how I’d approach it (I’ve taught this to 100s of students and followed it myself to land interviews at 3+ FAANGs):
► Step 1: Learn to Code (from scratch, even if you’re from non-CS background)
I helped my sister go from zero coding knowledge (she studied Biology and Electrical Engineering) to landing a job at Microsoft.
We started with:
- A simple programming language (C++, Java, Python — pick one)
- FreeCodeCamp on YouTube for beginner-friendly lectures
- Key rule: Don’t just watch. Code along with the video line by line.
Time required: 30–40 days to get good with loops, conditions, syntax.
► Step 2: Start with DSA before jumping to development
Why?
- 90% of tech interviews in top companies focus on Data Structures & Algorithms
- You’ll need time to master it, so start early.
Start with:
- Arrays → Linked List → Stacks → Queues
- You can follow the DSA videos on my channel.
- Practice while learning is a must.
► Step 3: Follow a smart topic order
Once you’re done with basics, follow this path:
1. Searching & Sorting
2. Recursion & Backtracking
3. Greedy
4. Sliding Window & Two Pointers
5. Trees & Graphs
6. Dynamic Programming
7. Tries, Heaps, and Union Find
Make revision notes as you go — note down how you solved each question, what tricks worked, and how you optimized it.
► Step 4: Start giving contests (don’t wait till you’re “ready”)
Most students wait to “finish DSA” before attempting contests.
That’s a huge mistake.
Contests teach you:
- Time management under pressure
- Handling edge cases
- Thinking fast
Platforms: LeetCode Weekly/ Biweekly, Codeforces, AtCoder, etc.
And after every contest, do upsolving — solve the questions you couldn’t during the contest.
► Step 5: Revise smart
Create a “Revision Sheet” with 100 key problems you’ve solved and want to reattempt.
Every 2-3 weeks, pick problems randomly and solve again without seeing solutions.
This trains your recall + improves your clarity.
Coding Projects:👇
https://whatsapp.com/channel/0029VazkxJ62UPB7OQhBE502
ENJOY LEARNING 👍👍
Here’s exactly how I’d approach it (I’ve taught this to 100s of students and followed it myself to land interviews at 3+ FAANGs):
► Step 1: Learn to Code (from scratch, even if you’re from non-CS background)
I helped my sister go from zero coding knowledge (she studied Biology and Electrical Engineering) to landing a job at Microsoft.
We started with:
- A simple programming language (C++, Java, Python — pick one)
- FreeCodeCamp on YouTube for beginner-friendly lectures
- Key rule: Don’t just watch. Code along with the video line by line.
Time required: 30–40 days to get good with loops, conditions, syntax.
► Step 2: Start with DSA before jumping to development
Why?
- 90% of tech interviews in top companies focus on Data Structures & Algorithms
- You’ll need time to master it, so start early.
Start with:
- Arrays → Linked List → Stacks → Queues
- You can follow the DSA videos on my channel.
- Practice while learning is a must.
► Step 3: Follow a smart topic order
Once you’re done with basics, follow this path:
1. Searching & Sorting
2. Recursion & Backtracking
3. Greedy
4. Sliding Window & Two Pointers
5. Trees & Graphs
6. Dynamic Programming
7. Tries, Heaps, and Union Find
Make revision notes as you go — note down how you solved each question, what tricks worked, and how you optimized it.
► Step 4: Start giving contests (don’t wait till you’re “ready”)
Most students wait to “finish DSA” before attempting contests.
That’s a huge mistake.
Contests teach you:
- Time management under pressure
- Handling edge cases
- Thinking fast
Platforms: LeetCode Weekly/ Biweekly, Codeforces, AtCoder, etc.
And after every contest, do upsolving — solve the questions you couldn’t during the contest.
► Step 5: Revise smart
Create a “Revision Sheet” with 100 key problems you’ve solved and want to reattempt.
Every 2-3 weeks, pick problems randomly and solve again without seeing solutions.
This trains your recall + improves your clarity.
Coding Projects:👇
https://whatsapp.com/channel/0029VazkxJ62UPB7OQhBE502
ENJOY LEARNING 👍👍
❤2
DSA (Data Structures and Algorithms) Essential Topics for Interviews
1️⃣ Arrays and Strings
Basic operations (insert, delete, update)
Two-pointer technique
Sliding window
Prefix sum
Kadane’s algorithm
Subarray problems
2️⃣ Linked List
Singly & Doubly Linked List
Reverse a linked list
Detect loop (Floyd’s Cycle)
Merge two sorted lists
Intersection of linked lists
3️⃣ Stack & Queue
Stack using array or linked list
Queue and Circular Queue
Monotonic Stack/Queue
LRU Cache (LinkedHashMap/Deque)
Infix to Postfix conversion
4️⃣ Hashing
HashMap, HashSet
Frequency counting
Two Sum problem
Group Anagrams
Longest Consecutive Sequence
5️⃣ Recursion & Backtracking
Base cases and recursive calls
Subsets, permutations
N-Queens problem
Sudoku solver
Word search
6️⃣ Trees & Binary Trees
Traversals (Inorder, Preorder, Postorder)
Height and Diameter
Balanced Binary Tree
Lowest Common Ancestor (LCA)
Serialize & Deserialize Tree
7️⃣ Binary Search Trees (BST)
Search, Insert, Delete
Validate BST
Kth smallest/largest element
Convert BST to DLL
8️⃣ Heaps & Priority Queues
Min Heap / Max Heap
Heapify
Top K elements
Merge K sorted lists
Median in a stream
9️⃣ Graphs
Representations (adjacency list/matrix)
DFS, BFS
Cycle detection (directed & undirected)
Topological Sort
Dijkstra’s & Bellman-Ford algorithm
Union-Find (Disjoint Set)
10️⃣ Dynamic Programming (DP)
0/1 Knapsack
Longest Common Subsequence
Matrix Chain Multiplication
DP on subsequences
Memoization vs Tabulation
11️⃣ Greedy Algorithms
Activity selection
Huffman coding
Fractional knapsack
Job scheduling
12️⃣ Tries
Insert and search a word
Word search
Auto-complete feature
13️⃣ Bit Manipulation
XOR, AND, OR basics
Check if power of 2
Single Number problem
Count set bits
Coding Interview Resources: https://whatsapp.com/channel/0029VammZijATRSlLxywEC3X
ENJOY LEARNING 👍👍
1️⃣ Arrays and Strings
Basic operations (insert, delete, update)
Two-pointer technique
Sliding window
Prefix sum
Kadane’s algorithm
Subarray problems
2️⃣ Linked List
Singly & Doubly Linked List
Reverse a linked list
Detect loop (Floyd’s Cycle)
Merge two sorted lists
Intersection of linked lists
3️⃣ Stack & Queue
Stack using array or linked list
Queue and Circular Queue
Monotonic Stack/Queue
LRU Cache (LinkedHashMap/Deque)
Infix to Postfix conversion
4️⃣ Hashing
HashMap, HashSet
Frequency counting
Two Sum problem
Group Anagrams
Longest Consecutive Sequence
5️⃣ Recursion & Backtracking
Base cases and recursive calls
Subsets, permutations
N-Queens problem
Sudoku solver
Word search
6️⃣ Trees & Binary Trees
Traversals (Inorder, Preorder, Postorder)
Height and Diameter
Balanced Binary Tree
Lowest Common Ancestor (LCA)
Serialize & Deserialize Tree
7️⃣ Binary Search Trees (BST)
Search, Insert, Delete
Validate BST
Kth smallest/largest element
Convert BST to DLL
8️⃣ Heaps & Priority Queues
Min Heap / Max Heap
Heapify
Top K elements
Merge K sorted lists
Median in a stream
9️⃣ Graphs
Representations (adjacency list/matrix)
DFS, BFS
Cycle detection (directed & undirected)
Topological Sort
Dijkstra’s & Bellman-Ford algorithm
Union-Find (Disjoint Set)
10️⃣ Dynamic Programming (DP)
0/1 Knapsack
Longest Common Subsequence
Matrix Chain Multiplication
DP on subsequences
Memoization vs Tabulation
11️⃣ Greedy Algorithms
Activity selection
Huffman coding
Fractional knapsack
Job scheduling
12️⃣ Tries
Insert and search a word
Word search
Auto-complete feature
13️⃣ Bit Manipulation
XOR, AND, OR basics
Check if power of 2
Single Number problem
Count set bits
Coding Interview Resources: https://whatsapp.com/channel/0029VammZijATRSlLxywEC3X
ENJOY LEARNING 👍👍
❤2
Learning Python in 2025 is like discovering a treasure chest 🎁 full of magical powers! Here's why it's valuable:
1. Versatility 🌟: Python is used in web development, data analysis, artificial intelligence, machine learning, automation, and more. Whatever your interest, Python has an option for it.
2. Ease of Learning 📚: Python's syntax is as clear as a sunny day!☀️ Its simple and readable syntax makes it beginner-friendly, perfect for aspiring programmers of all levels.
3. Community Support 🤝: Python has a vast community of programmers ready to help! Whether you're stuck on a problem or looking for guidance, there are countless forums, tutorials, and resources to tap into.
4. Job Opportunities 💼: Companies are constantly seeking Python wizards to join their ranks! From tech giants to startups, the demand for Python skills is abundant.🔥
5. Future-proofing 🔮: With its widespread adoption and continuous growth, learning Python now sets you up for success in the ever-evolving world of tech.
6. Fun Projects 🎉: Python makes coding feel like brewing potions! From creating games 🎮 to building robots 🤖, the possibilities are endless.
So grab your keyboard and embark on a Python adventure! It's not just learning a language, it's unlocking a world of endless possibilities.
1. Versatility 🌟: Python is used in web development, data analysis, artificial intelligence, machine learning, automation, and more. Whatever your interest, Python has an option for it.
2. Ease of Learning 📚: Python's syntax is as clear as a sunny day!☀️ Its simple and readable syntax makes it beginner-friendly, perfect for aspiring programmers of all levels.
3. Community Support 🤝: Python has a vast community of programmers ready to help! Whether you're stuck on a problem or looking for guidance, there are countless forums, tutorials, and resources to tap into.
4. Job Opportunities 💼: Companies are constantly seeking Python wizards to join their ranks! From tech giants to startups, the demand for Python skills is abundant.🔥
5. Future-proofing 🔮: With its widespread adoption and continuous growth, learning Python now sets you up for success in the ever-evolving world of tech.
6. Fun Projects 🎉: Python makes coding feel like brewing potions! From creating games 🎮 to building robots 🤖, the possibilities are endless.
So grab your keyboard and embark on a Python adventure! It's not just learning a language, it's unlocking a world of endless possibilities.
❤4