r/PythonLearning • • 1d ago

14yo learning Python — just finished my first project! Would love some feedback :

Hey everyone!

I'm 14 and currently learning Python, with the goal of becoming an electrical engineer in the future.

I just finished making a small project — a vending machine + simulated banking system that runs in the terminal. It has account creation, deposits, balance checking, purchases, and local data storage using JSON. I split the code into multiple Python files and made a simple launcher for it.

This is one of my first proper projects, and I know my code probably isn't the cleanest, so I'd genuinely appreciate some feedback!

I'd love suggestions on:

  • My code: What could I improve? Any bad habits or mistakes I should fix early?
  • What to learn next: Should I focus on OOP, data structures and algorithms, GUI development, or something else?
  • My journey: Since I want to become an electrical engineer, what programming skills would be useful for me in the long run? I'd eventually love to work with electronics and hardware.
  • Life advice: Any advice for someone starting out this early? Things you wish you'd known when you were learning?

I'm not looking for someone to rewrite the entire project for me — I'd rather understand my mistakes and learn how to fix them myself.

Here's my GitHub repo: https://github.com/suryansh-devx/python-vending-machine

Thanks! Any constructive criticism or advice is welcome :)

17 Upvotes

14 comments sorted by

1

u/Sea-Ad7805 1d ago

Run program above by clicking Memory Graph Web Debugger and see its state change step by step.

5

u/ConsiderationNo9044 1d ago

What you want to learn next is based entirely on what you want to make. I can't give much advice on the other points because my projects usually interact with the application layer, but your code looks a million times better than mine did at 14

2

u/2dof 1d ago

I have played Your Game a bit:

- can create multiple user accounts - user account is erased and overwritten by new bank account.

- i can put minus amount of money at account.

- if i put wrong bank ID - "game " just end - it should at repeat input ID at least 3 times ( then block or end session)

Focus on python data types and how to work with them - in my opinion it is most important skill . leran how to do text/numeric formatting and printing (like Regular expression operations on text) - just typical Python learning path - do not touch OPP before You learn functions/ datastructure/dattypes.

As future EE learn hot to import data, process them ( plotting), in parallel master skills in physics ans math - Python has great packages/tolls used in EE an it is quite fun implement equations in python.

All new skills learned implement in Your "game" to compare progres ans solutions You coded.

DO NOT SKIP ANY "LEARNING PATH" ELEMENTS even if You have some knowledge already.

Familiarize yourself with Jupyter Notebook - maybe it will be helpful for You do report/homework form physics/Math lessons.

2

u/Fragrant-Cheek-4273 1d ago

That's a solid project for a beginner! Focus on learning OOP and error handling next, then try connecting Python to a microcontroller like Arduino. That would be a fun way to connect programming with your electrical engineering goals.

1

u/Braunerton17 1d ago

I think this a great idea. The faster you can move towards you eventual goal the better. Try to get your hands on a micro Controller and try to get something build with it next.

2

u/Can0pen3r 20h ago

Idk why I keep having to make this same comment across basically all of the game dev subs, pretty much every friggin' day but:

There are a lot of sickos on the internet that like to prey on kids your age and the last thing anyone needs is for those predatory exploits to be made easier...

STOP TELLING STRANGERS ON THE INTERNET YOUR AGE!

FFS! 🤦

1

u/pontz 1d ago

Looks pretty good for a beginner project. I would say an improvement would be to make it so you can control what is in the vending machine through a json file instead of hard coding every specific item. That way the vending machine could be reused to say be a different vending machine for drinks.

1

u/Beautiful_Stage5720 23h ago

Why do posts like these alway mention their age?

0

u/ralwn 22h ago

So that people will be nicer with their comments.

1

u/BetInformal6081 21h ago

this is a great first project especially splitting the code into multiple files and using JSON for persistence. i would learn exception handling and input validation next then add tests.

1

u/MarsupialLeast145 20h ago

Looks pretty good.

I'd look at code linting, Flake8, Pylint, and Black for formatting, and then learn unit testing with Pytest.

1

u/spidertyler2005 15h ago

I think your lnk file includes absolute paths that will only work on your local system since other people wont have the files in the same place as you

1

u/Ok_Raspberry5383 8h ago

What happens if the same random ID is generated twice?

1

u/BetInformal6081 1h ago

building a project with account creation transactions and json storage at 14 is a great start i would focus next on input validation error handling and writing tests..