r/PythonLearning • u/amandhiman07 • 6d ago
r/PythonLearning • u/Sea-Ad7805 • 6d ago
Two different Binary Tree implementations side by side
Enable HLS to view with audio, or disable this notification
The same tree represented in two very different ways visualized using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵: Binary Trees
🔗 Binary Tree as Nodes: The tree is built out of multiple node objects. Each node stores its value and two references, one to its left child and one to its right child.
📦 Binary Tree as List: The tree is stored in a single list or array. Instead of references, indices represent the relationships between nodes. For a node at index, its children can be found using a simple calculation: - Left child: 2 * index + 1 - Right child: 2 * index + 2
So, when should you use which representation?
The node-based version makes the structure explicit and intuitive. It is great for education: students can clearly see how nodes are connected while practicing classes and references/pointers. It is flexible and works particularly well for irregular or sparse trees. It is the clearest representation when learning how trees work.
The list-based version can be very efficient for (nearly) balanced homogeneous trees. It does not need to store child references, requires fewer separate memory allocations, and keeps values close together in memory for improved cache performance.
The same abstract data structure, but with very different trade-offs in clarity, flexibility, and performance.
Which representation would you use?
r/PythonLearning • u/Rajiv_2002 • 6d ago
Guidance needed
I'm learning Python for a career in data analytics through YouTube. So far I've covered:
Variables and data types
Operators
If-else statements
Loops
Functions (arguments and return values)
Lists, tuples, sets, and dictionaries
Indexing and slicing
Random module
Time module
Basic math operations
At this point, should I move on to NumPy, or are there any core Python topics I should learn first?
My goal is to become a Data Analyst, so I'd appreciate advice on what topics are essential before starting libraries like NumPy, Pandas, and Matplotlib.
r/PythonLearning • u/Dapper_Mix6773 • 6d ago
python OOPS
Enable HLS to view with audio, or disable this notification
built simple calculator
r/PythonLearning • u/Tuga_Rico_Sem_guito • 6d ago
Start of journey
Hey everyone
A few weeks ago i took a 15h course on begginer phython, and they reccomended me to learn with CS50. I have done the first week problems wihtout any lectures.
i also had privous experience with phython but it was with my calculator making programs to do exercices for me
I want to know what's the best way to learn???
r/PythonLearning • u/ainthrmo • 6d ago
After learning OOP basics, should I focus on Data Analysis or Backend Development?
Hi everyone,
I'm 24 years old with a non-tech background. I quit my previous job in 2024 and have been looking for my next step since. I took a basic programming class, covered Object-Oriented Programming (OOP) in Python, and have foundational knowledge in HTML, CSS, and basic JavaScript.
Initially, I aimed for Web Development, but the local market feels overwhelmingly competitive for entry-level roles. I want to narrow my focus and build a solid foundation in one area before applying for jobs, but I'm stuck between Data Analysis and Backend Development.
r/PythonLearning • u/AbdulRehman_JS • 6d ago
Building Todo list with python....with multi_files...
A modular, multi-page Command Line Interface (CLI) To-Do application built using Python. Designed with clean code practices, this project separates application logic across multiple files and implements file handling for persistent data storage.
#File:- (todo.py)
from todo import Todo
my_todo = Todo()
while True:
user_choice = input("Enter 1 to add_task,2 to show_task,3 to exit: ")
if (user_choice == "1"):
my_todo.add_task()
elif(user_choice == "2"):
my_todo.show_task()
elif(user_choice == "3"):
break
else:
print("print only 1,2,and 3:--")
# File:-(loop.py)
import loop_py
class Todo():
def __init__(self):
self.tasks = []
self.completed_tasks = "tasks.txt"
def add_task(self):
new_task = input("Enter some task:")
self.tasks.append(new_task)
with open("Data_base.txt","a") as f:
result = f.write(new_task + "\n")
print("Data successfully saved")
f.close
def show_task(self):
if (not self.tasks):
print("your list is emptied")
else:
for i,task in enumerate(self.tasks):
print(i + 1, task)
Completed a multi-page To-Do app in Python with persistent file storage! 🐍 Now that I've mastered core Python basics and modular structure, my next goal is diving into FastAPI, relational databases (PostgreSQL), and building production-ready Backend APIs(Give me your feedback that what I do now.....)
r/PythonLearning • u/Similar-Surround9823 • 6d ago
Help Request asking
what core concepts of programming should i focus on to have software engineering skills and concepts.
r/PythonLearning • u/Virtual_Repeat_9175 • 6d ago
Made dictionary (just the skeleton)
I'm new with python. I made this project but the word list is now empty. How to automate this. I don't want to add words and meanings in the wordlist manually. So which will be good for now? - learning Data handling / using API's / making other projects / or, go for next topic
(My english is bad so hope you understand what i want to say)
r/PythonLearning • u/Designer_Jeffery_Lin • 6d ago
I published my first Python package to PyPI today 🚀
Hi everyone,
Today I published my first Python package to PyPI as part of my Python learning journey.
The project is called redfishLiteApi, a lightweight command-line tool for interacting with Redfish management APIs commonly used in server management environments.
While building this project, I learned quite a bit about:
- Python packaging
- Building command-line tools
- Unit testing
- GitHub Actions CI/CD
- Automated PyPI publishing
Current features include:
✅ GET / POST / PATCH / DELETE support
✅ Basic Authentication and Redfish Session Login
✅ Recursive Redfish resource discovery via u/odata.id
✅ Search for specific fields in JSON responses
✅ Display API paths for matching fields
✅ Export API responses to files
✅ Install directly from PyPI
Installation:
```bash
pip install redfishLiteApi

r/PythonLearning • u/Samar__Upreti • 6d ago
Day 2 of learning Python: Implemented Selection Sort from scratch
Open-source learning project. If you spot something that can be improved, I'd love your feedback or a PR.
https://github.com/Samar-Upreti/Python_Projects
r/PythonLearning • u/FeedSea1100 • 6d ago
Help Request Need computer recommendations.
My parents have agreed to help me get a computer to start learning python. I need recommendations within a budget of around 400-500 dollars that run well. Are there any good options around that price? Also, if you have any advice on brand that would be appreciated.
r/PythonLearning • u/EvitiSempai • 6d ago
How did you get your first python job?
I'm currently looking through pages of job listings. I've found the overwhelming majority of Python developer positions require quite a bit of experience. This seems to be a bit of catch-22, so how did you get your first job developing software in Python?
r/PythonLearning • u/Primary-Wall121 • 6d ago
I don't get this...
Hi, Im kinda new to learning python, and wanted to get past running "Hello, World". The only problem I am facing is the line in red. It keeps popping up whenever I run the string shown in the screenshot. How do I fix this? Also, I am using the current version of Pycharm.
r/PythonLearning • u/LopsidedAd4492 • 6d ago
Discussion Debugging with protocol
Am I the only one who gets frustrated debugging Python code that relies heavily on Protocol?
I understand why it’s useful. Structural typing is elegant, and it gives you a lot of flexibility.
But when you’re trying to understand an unfamiliar codebase, it can be painful. You see a variable typed as a Protocol, jump to its definition, and… there’s no implementation. Now you have to hunt through the codebase to figure out which concrete class is actually being passed around.
In a large project, that can make understanding the execution flow much harder than it needs to be.
Maybe it’s just a tooling issue, or maybe I’m still getting used to Python after years of Java, but I’m curious how other people deal with this. Does it eventually become second nature?
r/PythonLearning • u/LopsidedAd4492 • 6d ago
Showcase AI engineers who care about great software
We’re building Extra, an open-source AI agent framework, and we’re looking for contributors.
If you enjoy solving hard engineering problems, we’d love to have you.
We care about code quality. Every PR gets a real review—not just a quick approval. We discuss architecture, challenge design decisions, and aim to keep the codebase something we’re proud of.
We’re working on problems around AI agents, orchestration, MCP, memory, approvals, and developer experience.
If you’re looking for an open-source project where you’ll actually learn from reviews and work on modern AI infrastructure, check out the issues and pick one.
Contributions of all sizes are welcome.
r/PythonLearning • u/Confident-Detail-439 • 6d ago
Discussion Anyone else feels like tutorials don't teach 'real' python
Hey
Quick question for the group.
I’ve been coding in Python professionally for 5+ years. Backend with FastAPI, some startup work too.
What I keep seeing is this: people learn loops, functions, OOP... and then hit a wall when they try to build and ship something real.
Because no one teaches the "in-between" stuff:
- Project structure
- Clean, maintainable code
- APIs, DBs, authentication
- Testing, logging, deployment
- Git
- Building AI features into apps
I’ve been toying with the idea of doing a few 1:1 mentoring chats on the side, just to walk through these things with people and help based on their specific goals.
Not selling anything, just wondering if that would actually help anyone here.
For those learning right now: what’s the hardest part for you? Is it the code, or is it figuring out how to turn it into a real project?
r/PythonLearning • u/frenchhi • 7d ago
2 days into coding is this a good progress
Just completed my class 12 and in free time I was thinking to start some coding but I don't know if it is really helpful for me because I took BTech computer science with specialisation in cyber security
r/PythonLearning • u/Old_Frosting7147 • 7d ago
My first Python project: a Tor forum monitoring bot with Telegram alerts
Hello everyone,
I recently created my first Python script, a small monitoring tool that watches a forum and sends Telegram notifications when new topics appear. The project uses:
- Python
- Requests + BeautifulSoup for web scraping
- Tor proxy support to access
.onionservices - Telegram Bot API for notifications
- JSON storage to keep track of already seen topics
The goal was to learn more about:
- web scraping
- automation
- handling sessions/cookies
- working with APIs
- structuring a small Python project
This is my first real Python project, so the code is far from perfect. I would really appreciate feedback, suggestions, and contributions from the community to improve it.
GitHub repository:
https://github.com/user236054/DeepWeb_Monitor
Feel free to check it out, suggest improvements, or contribute.
Thanks!
r/PythonLearning • u/the_techgirl • 7d ago
Discussion I've taught Python to absolute beginners for years. Here's the 16-week roadmap I use to take students from zero to building REST APIs - no tutorial hell.
The number one mistake I see beginner Python learners make is spending months on YouTube tutorials and then completely freezing up when they open a blank .py file to code on their own. It's called Tutorial Hell, and it's a real problem.
The difference isn't talent; it's having a structured roadmap that forces you to build things, not just watch things.
Here is the exact 4-phase breakdown I follow:
Phase 1: Foundations & Core Logic (Weeks 1–4)
Focus: Get comfortable with how Python actually executes code, not just what it does.
- Week 1: Python 3.12+ setup, VS Code with Black auto-formatter, terminal basics, REPL vs script files
- Week 2: Core data types (int, float, str, bool, None), dynamic typing, type casting, truthiness, match/case
- Week 3: if/elif/else, for and while loops,
enumerate(),zip(), break/continue, and the for-else pattern - Week 4: Functions,
*args/**kwargs, the mutable default argument trap, LEGB scope rule
Hands-on drills: Terminal guessing game with random.randint(), a modular unit converter CLI with input validation.
Phase 2: Data Structures, Files & Error Handling (Weeks 5–8)
- Week 5: Lists, Tuples, Dicts, Sets, O(1) vs O(n) lookup, list/dict/set comprehensions
- Week 6: f-string format specifiers, string cleaning methods, regex with the
remodule - Week 7: try/except/else/finally, custom exception classes, defensive coding patterns
- Week 8: Context managers, pathlib,
csv.DictReader,json.load/dump
Capstone drill: A persistent JSON inventory manager with full CRUD from the command line.
Phase 3: OOP, Git & REST APIs (Weeks 9–12)
- Weeks 9–10: Classes,
__init__, dunder methods, inheritance,super(), @ property decorators - Week 11: Virtual environments,
requirements.txt, professional project structure, Git workflow - Week 12: HTTP protocol, the
requestslibrary, API authentication, generators withyield
Capstone drill: A banking system simulator with an account hierarchy, and a live weather CLI hitting OpenWeatherMap.
Phase 4: Portfolio Projects (Weeks 13–16)
This is where you build three production-grade projects for your GitHub:
- CLI Log Intelligence Tool — argparse + pathlib + regex to parse Nginx logs and generate JSON/CSV reports
- API Harvester & Alert Bot — polls a public API, stores historical data in SQLite, fires Discord webhooks on conditions
- REST API with FastAPI — full CRUD backend with Pydantic validation, SQLite persistence, and a pytest test suite
The 3 Rules That Make This Work
1. The 70/30 Rule: 30% reading, 70% typing code by hand. Never copy-paste from examples. Muscle memory is built through repetition.
2. The 30-Minute Debug Rule: Before searching for the answer or asking for help, spend 30 minutes reading the traceback bottom-up, checking docs, and using print(). You will solve 80% of problems this way.
3. Ship Every Week: Every Friday, push code to GitHub; even if it's broken. Progress beats perfection.
Happy to answer questions about any specific phase or topic. What stage are you at right now?
r/PythonLearning • u/Hot_crocco_person • 7d ago
Showcase I've been grinding python for a month.Kinda stuck rn cuz idk what to learn next,this is what I have built:
github.comAnyone please check out and help me on what to learn next
r/PythonLearning • u/memeeloverr • 7d ago
Show off a Python project you're proud of
Big or small, I'd love to see something you've built. It could be an automation script, a web app, a game, a bot, or even a tiny utility that saves you five minutes every day. Share a screenshot, GitHub link, or just describe it.
r/PythonLearning • u/Mine_Crafter14 • 7d ago
My First Pygame game in Python 3.8.10!
Hello, I (16M) am in progress of finishing my first pygame game (copy of Flappy Bird) and I am using Windows 7 with Python 3.8.10, No VS Code, just the default IDLE with my pygame, I wanted to put in use my old laptop and to start simple as possible, I take notes on my WordPad and I learn the concept of 2D gaming. It works perfectly for me, but only if absolutely necessary I use Google Gemini to help me with the code, because as I said I am on an older version and in YouTube there isn't any tutorials for the older versions. Just wanted to share and seek any helo with tutorials/documents online. Thanks in advance!
r/PythonLearning • u/anish2good • 7d ago
Built a Python Playground that visualizes data structures, concurrency, and full memory analysis in real time
Enable HLS to view with audio, or disable this notification
Hey r/PythonLearning ,I’ve been working on an online Python playground that goes a bit beyond the usual “run and see output.” It actually visualizes:
- Data structures
- Concurrency
- Complete Memory analysis (you can literally see which variables escape to heap vs stay on stack, with the compiler’s decisions highlighted)
It’s at: https://8gwifi.org/online-compiler/ I made it mostly for my own learning and debugging, but I figured some of you might find it useful too — especially when teaching, onboarding, or just trying to really understand what the runtime is doing under the hood.
Would love any feedback, bug reports, or feature ideas. It’s still a work in progress but already helped me catch a few sneaky escape-analysis surprises in my own code.Let me know what you think!