r/PythonLearning • • 26d 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 :)

36 Upvotes

37 comments sorted by

•

u/Sea-Ad7805 26d ago

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

→ More replies (1)

7

u/ConsiderationNo9044 26d 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

1

u/Defiant_Meal1898 24d ago

Thanks for the compliment and no worries!

5

u/Can0pen3r 25d ago edited 25d 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! 🤦

2

u/Defiant_Meal1898 24d ago

okay sorry🥲

1

u/Can0pen3r 23d ago

It's cool, just please actually take it to heart 🙏 Not to sound like an overprotective parent or whatever but, I'm not trying to scold you; I'm just trying to keep you safe 😅

1

u/Defiant_Meal1898 22d ago

yeah i get it

2

u/2dof 26d 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.

1

u/Defiant_Meal1898 24d ago

okay thanks!

2

u/Fragrant-Cheek-4273 25d 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 25d 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.

1

u/pontz 26d 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/Defiant_Meal1898 24d ago

Thanks! This is a great idea for me.

1

u/spidertyler2005 25d 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/Defiant_Meal1898 24d ago

no if there is no file, then a file with that exact name is created

1

u/spidertyler2005 24d ago

Sure sure, but it points to user specific directories

1

u/Defiant_Meal1898 22d ago

owhhh! how do i solve it? and can you tell me how to make programs that can run on any pc?

1

u/spidertyler2005 17d ago

You use relative paths. If you want to make an exe, the easiest tool i know of is nuitka. Another good one is cx_freeze or pyinstaller.

1

u/Ok_Raspberry5383 25d ago

What happens if the same random ID is generated twice?

1

u/Defiant_Meal1898 24d ago

All the IDs aren't stored, only one ID can be stored on a person's computer, when another ID is created, the previous one gets deleted.

1

u/Ok_Raspberry5383 23d ago

What's the point of the ID then?

1

u/Defiant_Meal1898 22d ago

Bank ID is used to buy things, deposit money etc

1

u/Ok_Raspberry5383 22d ago

But an ID is used to identify something, if there's only ever one then why is it needed to identify anything?? I feel it's been added without a real purpose

1

u/Defiant_Meal1898 21d ago

it is needed to buy items from the vending machine, the ID contains money

1

u/Ok_Raspberry5383 20d ago

An ID cannot contain money, it's an identifier, it doesn't contain anything other than a value that is unique to a given entity.

I think this is an area you should try and understand in database design if you wish to improve this project. I would extend it to support multiple accounts and users, multiple accounts per user, etc with a proper 4NF DB design for storage

1

u/Defiant_Meal1898 20d ago

Thanks, i will try it

1

u/nullptr_0x 23d ago

Well done! It's a great start. Keep studying and learning.

1

u/Beautiful_Stage5720 25d ago

Why do posts like these alway mention their age?

0

u/ralwn 25d ago

So that people will be nicer with their comments.

1

u/[deleted] 25d ago

[removed] — view removed comment

1

u/[deleted] 24d ago

[removed] — view removed comment

1

u/Defiant_Meal1898 24d ago

okay thanks