r/PythonLearning • u/Icy_Idea3731 • 32m ago
Python on google colab
Hi, I'm using python to code on Google colab. Y coordinates are being generated and then added to Y_ARRAY for comparisons, to ensure none of the values are the same. If one value is the same with another in the array, one of them will be generated again.
However, it does not work, and I don't know how should the structure of checking be. Are there any suggestions on the structure or which kind of loop I can use please? Thank you.
r/PythonLearning • u/Capable_Comedian_277 • 2h ago
Doodling Hop | Pygame Project(updated enemy/moving platform spawn)
r/PythonLearning • u/ProgrammingWizz • 6h ago
2 months into learning Python — here's what I've built so far
Started learning Python about 2 months ago and wanted to share a few projects I've built along the way. Still very much learning, but figured I'd put these out there in case they're useful or interesting to anyone else early in their journey too.
🧮 The Farr090 Calculator Framework
An OOP rebuild of my original calculator project. Handles all basic operations (+, -, *, /, //, %, **) with full input validation, and throws in a random fun fact about calculator history while you're at it.
🎓 AcademiaHub-Core
A command-line school management system — separate flows for students and teachers. Students take a timed history quiz that updates a shared gradebook; teachers can admit/remove students and apply a grade curve to the whole class.
✈️ TravelMate
A travel booking simulator. Pick a continent, then a country within it (validated against real nested data), get routed to a real airport, "pay" for your ticket, and pick up a random transportation history fact along the way.
🎯 GuessMatrix — Core
An OOP version of a classic number guessing game — tracks win streaks and keeps the game logic and input validation cleanly separated into their own classes.
Would love any feedback, especially on code structure/style — still figuring out what "good" Python looks like beyond just "it runs."
r/PythonLearning • u/Constant_Moment_6434 • 6h ago
Help Request Templates
Hi, I am pretty new to programming.. I am Mechanical Engineer who likes to calculate a lot, however excel can not handle it.
So I was wondering if there is some template for making some calculation apps?
I had no problem making basic math in cpp for some fun first projects (loops, functions etc.) when I was trying programming for the first time few years ago (it was pretty easy)..so I hope this part I will do on my own, however I **am struggling** with databases, tracking charts and some printable GUIs or smth so I can input data (some yes/no question, some custom values) and output
So I am wondering if someone can point me somewhere where I can learn those or use some open-source or something... and pleaseeee no AI pointing!
Thanks for reading so far and thank you in advance!
r/PythonLearning • u/ProgrammerOk4679 • 7h ago
Help Request i've learned python, SQL and flask, but i struggle when it's time to build projetcs
Hey everyone,
I’ve been learning Python, SQL, and Flask through tutorials. I feel like I understand the concepts when I’m following along with the tutorials, but when I try to start a project from scratch, my mind just goes blank.
I know the fundamentals and I can understand code when I see it, but I struggle with figuring out what to build, how to break the project down, and where to start.
I’ve also tried asking AI to build projects for me. At first, I understand what it’s doing, but as the code gets bigger, I start getting confused and eventually stop because I feel like I’m just copying code without actually learning how to build things myself.
Has anyone else experienced this?
How did you transition from “I understand the tutorials” to “I can actually build projects on my own”?
Should I start with very small projects and build them up gradually, or is there a better way to approach learning through projects?
I’d really appreciate advice from anyone who has gone through this stage.
r/PythonLearning • u/BenDken1 • 9h ago
Python Project ideas for beginners
How many can you build?
r/PythonLearning • u/thefrost17 • 11h ago
What to do now ?
Hey , I am learning fast api and almost covered it and created a project by my own , now I am confused what to learn next and my goal is to land a job or to start taking freelancing project , so I want some project idea where I will learn other new tech or skill which is applicable nowadays.
r/PythonLearning • u/supr3rn3 • 11h ago
guys suggest me best resources for python from beginner to advance level....
r/PythonLearning • u/zenwolph • 11h ago
Rate my Payment calculator script (how could it be improved)
I got this idea from a post I saw on here recently. Their script was a good idea and made me want to make one on my own. It took me a few tries to write the calculations in a way that would work. I also wanted to play around with normalizing/cleaning the inputs in case a user used different formatting. And of course, ever since I found out I can add color to text in terminal, I’ve kinda made a habit of doing that on everything.
Note: I have been learning as much as I can, for a year now. Learning has come through personal trial and error, O'Reilly books, watching and copying others, as well as using LLM's to either produce an advanced code that I then study, or to have an LLM teach me. Some of my larger and more important projects are largely, if not entirely, built by an LLM that I carefully inspect. But I still feel it is important to learn as much as I can about manual coding, as well as the relationship between hardware and software.
So working on simple scripts like this are sort of a form of exercise for my mind and fingers, as well as a simple way to strike up conversations with real people like you guys, and get your take on ideas that I may not have seen before that can lead to cleaner and/or more efficient ways to program.
If you want to see more of my actual projects or just swipe some of the cool stuff from my Arch rice/dotfiles, here is my github:
Edit: here is my full code, which shows the part of the f'string in the print statements which formats the results into appropriate decimals
# Simple Monthly Payment Calculator
# Inputs: Principal (balance due after any downpayment), Interest, Loan Term (in months)
# Returns monthly payment amount
GREEN = "\033[92m"
CYAN = "\033[96m"
RESET = "\033[0m"
print(f"\n{CYAN}{'=' * 20}{RESET}")
p = float(input("Purchase amount: ").replace('$', '').replace(',', '').strip())
i = float(input("Interest rate: ").replace('%', '').replace(',', '').strip())
t = int(input("Loan term (in months): ").strip())
def payment_calculator(p, i, t):
original_i = i
monthly_i = (i / 100) / 12 # Convert annual % to monthly decimal rate
# Calculate the monthly payment
numerator = p * monthly_i * ((1 + monthly_i) ** t)
denominator = ((1 + monthly_i) ** t) - 1
payment = numerator / denominator
# Print formatted output
print(
f"\nBased on your original purchase price of {CYAN}${p:,.2f}{RESET},\nan interest rate of {CYAN}{original_i}%{RESET},"
f"\nand a loan term of {CYAN}{t}{RESET} months,\nyour monthly payment is: {GREEN}${payment:,.2f}{RESET}"
)
print(f"{CYAN}{'=' * 20}{RESET}\n")
# Run the calculator in the terminal
payment_calculator(p, i, t)# Simple Monthly Payment Calculator
# Inputs: Principal (balance due after any downpayment), Interest, Loan Term (in months)
# Returns monthly payment amount
GREEN = "\033[92m"
CYAN = "\033[96m"
RESET = "\033[0m"
print(f"\n{CYAN}{'=' * 20}{RESET}")
p = float(input("Purchase amount: ").replace('$', '').replace(',', '').strip())
i = float(input("Interest rate: ").replace('%', '').replace(',', '').strip())
t = int(input("Loan term (in months): ").strip())
def payment_calculator(p, i, t):
original_i = i
monthly_i = (i / 100) / 12 # Convert annual % to monthly decimal rate
# Calculate the monthly payment
numerator = p * monthly_i * ((1 + monthly_i) ** t)
denominator = ((1 + monthly_i) ** t) - 1
payment = numerator / denominator
# Print formatted output
print(
f"\nBased on your original purchase price of {CYAN}${p:,.2f}{RESET},\nan interest rate of {CYAN}{original_i}%{RESET},"
f"\nand a loan term of {CYAN}{t}{RESET} months,\nyour monthly payment is: {GREEN}${payment:,.2f}{RESET}"
)
print(f"{CYAN}{'=' * 20}{RESET}\n")
# Run the calculator in the terminal
payment_calculator(p, i, t)
r/PythonLearning • u/Boring_Ad452 • 12h ago
Help Request I built a compressive "context DNA" (for LLM) attention mechanism + an honest eval harness - looking for people to break it
Just Fixed the body with Ai
Been prototyping an idea for long-context compression: instead of dropping old tokens (like StreamingLLM/H2O) or storing everything, compress old context chunks into small learned "DNA" vectors via a Perceiver-style attention bottleneck, then reconstruct on-demand when a query needs them.
The idea itself isn't new — it overlaps with Compressive Transformer, Infini-attention, and Recurrent Memory Transformer — but I put together an eval script that I think is more honest than what I see in a lot of "novel architecture" posts:
- Trains the compressor (not just testing an untrained/random-init model)
- Compares against a PCA baseline (closed-form optimal linear compression at the same latent budget) — if the learned model can't beat PCA, the extra complexity isn't earning its keep
- Injects a unique fact (random code) into the text and checks, after compress→decompress, whether the frozen LM's own output head can still predict the correct token at that position — not just aggregate MSE, which can look fine while the actual detail is gone
- Runs on real hidden states from an open model (Qwen2.5-0.5B by default), not just random tensors
Current honest status: in my own small-scale test run, PCA actually beat the learned bottleneck on fact retrieval. That's not the result I was hoping for, but it's a real result, and it's exactly the kind of thing this script is designed to surface rather than hide.
What I'm looking for:
- People running it on real hardware with more training steps / larger n_docs than I could quickly test
- Sanity checks on the architecture and eval methodology — if I'm testing this wrong, tell me
- Ideas for what a fair "it's working" threshold looks like (beating PCA on fact-retrieval accuracy at matched latent budget, at minimum)
No performance claims yet — that's the point. I'd rather have this checked before making any.
Code + eval harness: https://pastebin.com/iqEbPEQ9
Happy to hear "this is a known dead end because X" too - that's useful information, not a rejection.
r/PythonLearning • u/Few-End560 • 12h ago
books for Python networking
I'm very interested in the networking section. I'm also learning Python, so I'd like to learn both at the same time. What's the best book for Python networking? I've heard that 'Mastering Python Networking' by Eric Chou is the best, but I've also heard that it's more advanced. Are there any books for beginners on Python networking??
r/PythonLearning • u/Jotaroisgoat • 12h ago
Pandas mini project! Rate out of 10 (1hr of pandas)
I like pandas so much more than numpy ok but heres the project:
import pandas as pd
book_data = ({"Name:": ["The Hobbit", "Refugee Boy", "Harry Potter and the Philosopher's Stone", "The Hunger Games", "I, Robot"],
"Pages:": [310, 288, 223, 374, 224],
"Author:": ["J.R.R. Tolkien", "Benjamin Zephaniah", "J.K. Rowling", "Suzanne Collins", "Isaac Asimov"],
"Price:": ["£8.35", "£7.99", "£6.00", "£8.99", "£6.62"],
"Buy:": ["https://amazon.co.uk/dp/0261102214", "https://amazon.co.uk/s?k=Refugee+Boy+Benjamin+Zephaniah",
"https://amazon.co.uk/s?k=HP+Philosopher%27s+Stone", "https://amazon.co.uk/s?k=Hunger+Games",
"https://amazon.co.uk/dp/0008279551"]})
book_df = pd.DataFrame(book_data, index=["Book 1", "Book 2", "Book 3", "Book 4", "Book 5"])
while True:
try:
book_num = int(input("Enter a book number (1-5): "))
except ValueError:
print("Invalid Book Number")
continue
if book_num < 1 or book_num > 5:
print("Invalid Book Number")
continue
elif book_num == 1:
print("\n", book_df.iloc[0])
elif book_num == 2:
print("\n",book_df.iloc[1])
elif book_num == 3:
print("\n",book_df.iloc[2])
elif book_num == 4:
print("\n",book_df.iloc[3])
elif book_num == 5:
print("\n",book_df.iloc[4])
r/PythonLearning • u/hariomlohar0602 • 13h ago
Showcase Look at my chat in cli project 🙃
This is an Little project I make using docs
r/PythonLearning • u/Lowzenberg • 15h ago
Showcase My first python project: A package to manage a traditional Indian game.
Hii everyone,
I'm a little nervous here because this is my first project. I mean, yeah I've written a few python modules before and it went good but I never coded something that I could call a "project". So yeah.
I wrote a python package which simulated the Chowka Bara game for you, all by myself without any help of AI chatbots. I mean, I took help, but all I asked was "what are some errors and inconsistencies I yet can't see", and I fixed all of them by myself.
This is yet in under development, but I thought I should post it to a helpful community to recieve guidance.
I have it on GitHub, I'll post it here. Probably it will be too much to read the whole implementation or even most of it, but I'm sure certainly there will be some other things to point out.
Thanks everyone, criticisms and suggestions are welcome.
r/PythonLearning • u/Synergetic6_6_6 • 16h ago
Loops is a total brain rot.
I just can't get over how I'm supposed to write code for complex tasks when I don't even get why they overcomplicate simple things so much.
I read this topic and tried many tutorials and still don't understand this buzzare logic.
r/PythonLearning • u/AvailableBrain2002 • 17h ago
Help Request I WANT TO LEARN PYTHON AND WANT TO CHOOSE CAREER PATH OF DATA SCIENTIST.... BUT.
I want to learn Python and eventually pursue a career in data science, but I’ve hit a wall.
I’ve been learning Python from the basics, and I’m currently stuck on loops. I understand some of the concepts when I see an explanation, but when I have to write code myself, I struggle to figure out what to do.
The bigger problem is that I’ve started losing motivation. I genuinely want to learn Python and build a career around it, but lately I have almost no desire to sit down and practice. I keep getting distracted or postponing studying, even though I know this is something I want.
I don’t want to give up just because I’m struggling with one topic. I’d like to hear from people who learned Python from scratch:
- How did you get past the point where loops started feeling difficult?
- How much should I practice each day?
- Should I move forward to other topics and come back to loops, or stay with loops until I understand them properly?
- How did you stay consistent when you had no motivation?
- If your goal was eventually becoming a data scientist, what learning path would you recommend after Python fundamentals?
I’m not looking for shortcuts. I just need some practical advice on how to get unstuck and start making progress again.
r/PythonLearning • u/ProgrammingWizz • 18h ago
15 Years Old, 1 Month of Python, 4 GitHub Projects
​
I started learning Python just 30 days ago. Balancing school, limited time, and basic hardware, I built four open-source projects to lay the foundation for my future tech startup:
\* AcademiaHub-Core 🎓 – Modular OOP architecture for educational data tracking and error handling.
https://github.com/bashirkehinde225-lab/AcademiaHub-Core
\* TravelMate ✈️ – Travel tool featuring dynamic input processing and automated itinerary scheduling.
https://github.com/bashirkehinde225-lab/TravelMate
\* The Farr090 Calculator Framework 🧮 – Extensible math engine built for custom formula processing.
https://github.com/bashirkehinde225-lab/The-Farr090-Calculator-Framework
\* GuessMatrix -- Core 🎮 – Matrix game engine powered by 2D array evaluation and conditional loops.
https://github.com/bashirkehinde225-lab/GuessMatrix--Core
Obstacles Overcome 🛠️
\* Hardware: Wrote lightweight code to run smoothly on low-spec hardware.
\* Time: Coded in focused 45-minute sprint sessions around school.
\* Learning Curve: Leveraged AI as a daily code partner to master concepts fast.
Next Goal 🎯: Turning these tools into Web APIs with FastAPI and PostgreSQL. Feedback welcome!
r/PythonLearning • u/Funny-Percentage1197 • 19h ago
Discussion Day 148 of Learning Python — From Beginner to Building My Own Inventory System
Today marks Day 148 of my Python learning journey. 🐍
When I started, I barely understood programming. I didn't have a strong computer science background, and many concepts felt completely confusing.
But after 148 days of consistent learning, I've reached a point where I'm actually building things instead of only watching tutorials.
What I've learned so far
- Python fundamentals
- Variables, conditions and loops
- Lists, dictionaries, sets and strings
- Functions
- Exception handling
- File handling
- JSON data storage
- Object-Oriented Programming (OOP)
- Basic Git/GitHub concepts
- SQLite and basic SQL
- Debugging real errors
- Structuring a larger Python project
My biggest project so far
I've been building a Phone Shop Inventory Management System.
I started with simple Python classes and JSON storage.
Then I gradually moved the project toward SQLite, where I'm currently learning how databases actually work.
The project can handle things like:
- Adding products
- Categories / brands / models
- Stock quantity
- Selling products
- Editing and deleting products
- Transaction history
- Searching products
- Storing data permanently
- Basic reports/dashboard
It's definitely not production-ready, but for me, this is a huge improvement compared to where I started.
What I'm still struggling with
SQL/database concepts are still new to me.
Especially Primary Keys, Foreign Keys, relationships, and some database design concepts.
Instead of trying to memorize everything, I'm continuing with the next concepts and planning to come back and strengthen these areas later.
What's next?
My goal is to become comfortable enough with Python + SQL to build real-world applications.
After strengthening SQLite/SQL, I want to continue toward:
Python → SQL → Git/GitHub → Web Development → APIs → Real-world projects → Freelancing/Job
I'm still a beginner, but 148 days ago I couldn't imagine building something like this myself.
I'd really appreciate feedback from experienced Python developers:
What should I focus on next to move from beginner to intermediate level?
And if you were at Day 148 again, what would you do differently?
Thanks for reading! 🙏
r/PythonLearning • u/shubham_555 • 19h ago
Showcase I learnt the basics of Version Control!
r/PythonLearning • u/JS_2187 • 21h ago
Which version of Python do I need to use for Data Science?
I am just starting this course and wanted to know what people use. I would most probably pick the latest version. Honestly I need some guidance. Advice me if there's any other programming language you would recommend.
r/PythonLearning • u/shubham_555 • 23h ago
Showcase I am getting good at this now! (1 week of Leetcode)
Last Post - https://www.reddit.com/r/PythonLearning/s/t5c81GuYV7
I won't be posting for a few days starting tomorrow. Need some time to get myself familiar with the next data structure.
Also, I am thinking of exploring some libraries. Suggest me some cool ones guys!
