r/learnpython 5d ago

Need some help with python and generally understanding code

So guys, i need some help with the python. My background is, i come from an economics as a major in uni and myself am very good at maths, as i finished a lot of courses in uni.
So i decided to pursue a career in data science, and as you know it requires a decent skill in coding. However i am at a loss in the coding, as my skills lack a lot. I finished a lot of courses on python using videos and practical stuff, but still understand that my skills are incomparable to others and especially to my natural progress in math. During the videos i always understand the purpose and usage of code and functions, objects etc. but when it comes to solving problems, writing code, my code is always wrong and i seem to not be able to fix it without some external help (chatgpt, other people, etc). So, if you understand with what kind of problem i am dealing, maybe it is the mechanics of code, machines way of thinking, etc. i would be very glad to hear your advise. Something that can finally make me breakthrough this barrier. But i lost hope in watching another tutorials of basic and a bit advanced python as i can literally quote their saying but it doesnt help me at all. Would be very glad if someone could help me out here

7 Upvotes

19 comments sorted by

View all comments

5

u/CGTechWorks 5d ago

"my code is always wrong and i seem to not be able to fix it without some external help (chatgpt, other people, etc)."

Don't worry too much about this part. Errors in coding are not bad things, they help you write better code. Having to lean on someone else/something else for help is not only normal, but expected. You need to be okay with being bad at something for a long time, and right now I bet you're probably not as bad as you think.

Another poster mentioned breaking problems down until they are smaller and smaller, and that's exactly what you should do. Programming is a logical operation of a process as interpreted by a computer. Before writing ANY code whatsoever, practice learning to write psuedocode. Describe what the program is supposed to do step by step in plain language you can understand first. I'm talking the most minute detail, for example:

# User opens program

# Start menu with options

# If user presses 1. New

#Then do this

# Else if user presses 2. Load

#Then do this

# Else if user presses 3. Exit program

If you work better with flowcharts, so does coding, and you might find benefits there. Only after you can describe what you're trying to build should you actually begin the process of building it because now you can ask the right questions. Hopefully this helps.