r/learnpython • • 10h ago

How Do I Actually Learn Python?

I’m sorry, this is probably a really dumb question but I’m picking up python as a hobby to learn between work and classes. I’ve never coded before and I’m not interested in doing it career-wise or anything like that. I just want to be able to understand the fundamentals of it. I’ve gone through many online courses as well as YouTube tutorials. I always get it in theory, when they explain the strings, integers, and whatnot, but when I actually go to write lines of code, I always find myself getting error codes, even when I follow the tutorial exactly, which honestly baffles me.

Does anybody have any tricks on how to deal with this learning curve? Something that might be extremely common knowledge to everybody else that I’m missing? Or any resources they could provide? I really want to learn how to code, I’m just not sure how I begin troubleshooting something that I don’t understand, if that makes sense.

16 Upvotes

55 comments sorted by

6

u/xselliehx 10h ago

hey :) fellow python student here! :) i actually had the exact same problem and what solved it for me was CS50P lectures from Harvard. David Malan is MARVELOUS teacher and the most important part is not to watch it through youtube as that is theory / not you doing the practicals. Do it via their own website or via the edX website (can be for free, just dont require the certificate) and then you have all the problems for you to solve, they go from easier to the more challenging ones etc. What was very helpful was their own chatbot, small duck that actually doesnt give you the answer right away, but leads you towards the correct solution so you have to solve it. Very very helpful! :) one of the best advices i got was to actually start coding even if i dont know much. They are doing it in their own VS Code so then the transition for your own possible projects is not that challenging :) hope I helped at least somehow, enjoy your study of python!

2

u/Glittering-Olive-404 10h ago

Thank you so much! I guess where I went wrong was from watching videos and jumping straight into coding instead of doing practicals (which i honestly didnt know they had, lol) thank you so so much for your help i appreciate it a lot !

1

u/Keinick_Mariazinha 9h ago

they actually issue a free digital certificate directly through the course site if you finish all the problem sets, so you dont even have to pay the platform fee.

7

u/Available_Safe1818 10h ago

Stop using videos, and write your own code. Learn to use Google.

1

u/Glittering-Olive-404 10h ago

I am trying to! But unfortunately I have no experience in coding at all so I need a baseline for this. My degree has nothing to do with coding and I didn’t know a single thing about coding a week ago, Google often gave me YouTube videos which I would watch but fail to be able to execute! I will try to start coding and seeing what works and what doesn’t more though instead of relying on videos!

3

u/Available_Safe1818 10h ago

Look for tutorials that are not videos. All the information is out there in non-video form.

1

u/av8rgeek 1h ago

Important: coding is implementation of an algorithm/logic on a computer. Learn the basic programming concepts and you can write in any language.

2

u/JaguarMammoth6231 10h ago

Getting errors is normal. You just need to read the error message, understand it, and fix it. Start with the first one, later errors might go away once you fix the first one.

1

u/Glittering-Olive-404 10h ago

This might be a really dumb question and I appreciate your response a lot, but is there any way to understand the error message? I guess it’s because I’m not used to any coding language that I have a harder time understanding it. Would it just be from experience? Thank you again for your response!!

2

u/JaguarMammoth6231 10h ago

Can you give an example?

1

u/Glittering-Olive-404 1h ago

Hello!!! Thank you so much for offering to help, I didn’t see this until now and I was just tinkering around with it during my lecture. I was struggling with the integers a lot because I was trying to condense my lines! I broke everything down and while it looks a lot longer, I think it helped me process where I went wrong and read the code more coherently, I’m going to try to separate all my code for now until I’m proficient enough to condense it! Sorry if I’m not using the right terminology

1

u/JaguarMammoth6231 1h ago

Ok, no problem. Sometimes just trying to get everything organized enough to explain it to someone is enough to figure it out yourself

1

u/Mandelbrots-dream 9h ago

Sometimes when I get stuck I copy the generic parts of the error message into google, or duckduckgo. Sometimes that helps me get unstuck.

1

u/RSkyhawk172 3h ago

If you don't mind using LLMs, I would suggest copying the entire error message (but not the code block that it happened on) into one and asking to explain it. If that doesn't get you far enough, you can copy the code block in to give it context, but I recommend that you specifically instruct it not to generate the right code for you and instead have it tell you what the problem is in plain language so that you need to fix it yourself. That way you'll learn what the mistake was and can learn how to avoid it.

2

u/SharkSymphony 10h ago

Errors are a major part of every programmer's existence. You have to learn to think the way the computer thinks. This is an essential part of the learning process!

What error are you getting? What code are you typing?

2

u/Glittering-Olive-404 1h ago

Hello!!!! Thank you so much for your willingness to help, I actually figured it out since everybody was encouraging me to take a step back and actually Code instead of just watching videos. I was taking the wrong approach to learning how to code and the replies made me realize that. I had to just break everything up into shorter lines so I could comprehend it better and begin to understand where I went wrong!

•

u/SharkSymphony 2m ago

Yup, take it one step at a time until you get better at it – and usually even then! Remember the Zen of Python:

> Beautiful is better than ugly.
> Explicit is better than implicit.
> Simple is better than complex.
> Complex is better than complicated.
> Flat is better than nested.
> Sparse is better than dense.
> Readability counts.

2

u/mc_pm 7h ago

Are you actually typing in code and trying to figure out why it isn't working? If not, then you're not really learning python.

Learning to program by watching videos is like learning to drive by watching videos. You can get the basic idea, but until you're actually there and doing it, it's not really all connecting.

1

u/Glittering-Olive-404 1h ago

I am! I appreciate your advice a lot, this made me take a step back and play around with the features and strings before the referencing tutorials and articles and that helped a lot! Thank you so much for taking time out of your day to respond and give me advice

2

u/av8rgeek 5h ago

To really learn it, you need to code in it. Not just watching videos to learn the concepts. Find a project and code it WITHOUT USING AI.

2

u/Glittering-Olive-404 1h ago

Definitely not going to use ai, regardless of how anybody feels about it I just feel like its counterintuitive to use something that will just solve everything for me rather than trying to learn and figure out where I went wrong myself! I’m trying to code but I got discouraged, thank you!

1

u/av8rgeek 1h ago

AI can be useful for learning how something works or learning how the syntax works, stuff like that. There is also benefit in knowing the PEP standards and the various python tutorial/reference sites.

1

u/Glittering-Olive-404 1h ago

100% there’s benefits in using AI when it comes to coding, but I think when I’m fed information as well as a solution (like the youtube videos) I tend to not process the information, I just copy it. For now, as a beginner, I think its best for me to properly digest my information so I can thoroughly understand what I’m doing right and wrong! As scary as it sounds to me right now, I’m going to try and do a project using some references from the resources that other people have given me in this thread and see how it goes! Thank you for your input again, I appreciate it greatly

1

u/av8rgeek 1h ago

I didn’t say to have it solve. :) have it explain why something does what it does. Learn the logic of what is happening. Ultimately, programming is just a set of logical instructions. Learn those concepts. A for loop in Python is the same thing in C, C++, Java, Perl, JS, Lua, C#, etc. Have AI help you understand what a specific piece of code does. Tell it not to fix the code. Tell it to give you hints. You have the right idea to write your own code. Having websites and Google searching is great. AI, used correctly, can be another valuable tool. (Yes, I know this contradicts what I initially said, but I think you got my point well.)

1

u/rhacer 10h ago

I would read or watch a "getting started" video, then start solving problems. Watching or reading won't make you proficient, doing will.

2

u/Glittering-Olive-404 10h ago

Thank you! I guess I’m just getting too bummed out by watching a plethora of videos that didn’t turn out to help me in actually writing code and I got discouraged by that! Thank you for your response !

1

u/Blumcole 8h ago

I'm also doing it as a hobby. I used the book Python Crash Course and I learned the fundamentals like that. And then maybe lock into a project that you want to make. For me it was a document renamer (for work) and a small database for tracking games. So you can use some libraries like tkinter, json, os,... I guess just Follow along with some tutorials or guides online, consult ai to explain some of the concepts. I also use a jupyter notebook to write down snippets of code.

1

u/Glittering-Olive-404 1h ago

Thank you for your recommendation!! I’ll definitely look into this later and I appreciate you a lot for giving me a little nod in the right direction

1

u/Outer_Space_ 7h ago

If you like idle/incremental games, I can't recommend 'The Farmer was Replaced()' enough.

It's an automation game where you write code to control a drone to plant and manage crops. The coding is essentially python, there's internal documentation, and the progression really hammers home foundational concepts step by step.

2

u/Glittering-Olive-404 1h ago

Thank you! I’m going to take a look at this in a bit; I think the software I’m using is just a bit too overwhelming for me at the moment and I need something to tone it down and make it more palatable for me as a beginner. I love idle and farming games so this id right up my alley LOL I didn’t know something like this existed, thank you so much

1

u/Outer_Space_ 1h ago

No problem! I’ve been itching to recommend it to people. It’s the only code-learning tool I’ve come across that makes me think about programming problem solving while I’m away from the computer. Like when you start to dream about Minecraft or whatever, this game has had me thinking about defining functions and organizing dependencies while I’m falling asleep.

1

u/desrtfx but other languages pro 6h ago

Stop youtube tutorials that give you the code and only make you retype it. They are useless.

Do a proper course: MOOC Python Programming 2026 from the University of Helsinki. Free, textual, extremely practice oriented and a proper first semester of "Introduction to Computer Science" course. The course, contrary to most tutorials does not give you the code to retype/copy but instead gives you the tools and makes you, the learner, develop the solution and implement it in code.

You need to program, which means that you need to develop everything from a given problem, to an algorithmic step by step solution for the problem and its sub-problems, that then, finally, can be implemented in code. Code is a late step in programming. It is not the beginning.

I always find myself getting error codes, even when I follow the tutorial exactly,

There are two things to unpack.

  1. Errors always tell you something. You need to learn to read, understand, and interpret the errors. Google (and, even though I don't like to recommend it, AI) can help a lot here.

  2. If you really did precisely copy the code from the tutorial there wouldn't be any errors. Programming is a domain of precision where even a missed comma, a misplaced semicolon, a large letter where a small one is expected and vice versa can cause huge problems. Alone in variable naming a is not the same as A in many programming languages (there are case insensitive ones, though, but Python is not one of them). True is not the same as true and so on.

Does anybody have any tricks on how to deal with this learning curve?

  1. proper course

  2. practice, practice, practice

  3. get acquainted with the language documentation. Learn to navigate, read, and understand it

  4. learn to read, understand, and interpret error messages - they are all helpful and meaningful

  5. learn to trace and debug your code - start with simple print statements and later move to using a proper debugger with breakpoints and step-by-step execution. Also, learn to trace your code in your head or on paper. These are all very important skills to build up.

  6. Patience. Learning programming is not easy and it takes considerable time, persistence, discipline, determination, patience, effort, and a certain stubbornness to not give up when things go haywire or rough.

1

u/Glittering-Olive-404 1h ago

Hello! This is a really, incredibly comprehensive reply and I appreciate you so much for putting time into this. I’m in lecture right now so I don’t have time to fully digest it but I have it saved in my notes so I can come back to it! This gave me a lot of insight on stuff that I wasn’t doing correctly and why I was getting so frustrated. I wasn’t taking the proper time to learn the steps of how to properly code and I was skipping parts of my learning curve hoping I’d be able to just magically figure it out. That was definitely my fault and this helped me a lot, I’m going to refer to this and use it as a checklist of sorts whenever I’m coding. Thank you so so much again! You have no idea how much this means to me

1

u/AlieMay525 2h ago

For me I was at a point I thought I’d never actually learn without using like 10 resources and even then I didn’t get it and felt stupid. 1.5 years later I’m timing myself on how fast I can code. Practice is the best way. And once you get it, the error messages make sense and the fix’s make sense too. And over time you’ll find yourself just kind of doing it and then only occasionally referencing a resource.

I am in college as a computer science major and I feel like that might be easier as I also was able to learn the process of how you come up with codes and using pseudocode as well. I originally went back to college because I wanted to learn coding for making mods in video games. Just keep practicing.

1

u/Glittering-Olive-404 1h ago

Hello! Thank you so much for your reply, if I can ask, are there any beginner projects (ex. Hello world, calculator, etc.) you did specifically to get to where you are now? Or did you just keep tinkering around with all the features and strings? I was honestly feeling really discouraged until I saw this reply. Thank you for your help!!

1

u/BotSlamminDayNNight 2h ago

looks like you're actually not getting it in theory. if you did, you'd know how to avoid most if not all the error codes, and the few you might get wouldn't baffle you.

given that the many online courses and youtube tutorials haven't helped, you're right to look for something else. have you tried old school, ie. books?

1

u/Glittering-Olive-404 1h ago

I took a step back and I’m realizing now that understanding it when a Youtube video is explaining it and actually understanding it enough to put it into practice are two completely different things. I’m going to look at more old school options because I’ve been suggested a few and I’m definitely going to play around with the software more. Thank you so much for your advice!!

3

u/stepback269 7h ago

This is an often repeated question. (example here)
Here's the answer:

Code comes last.

That's right. You shouldn't try to solve the problem by immediately dumping some code onto your blank slate. There's a lot of "pre-production" thinking and planning that has to come first.

Imagine that you are thinking of producing a movie.
Let's say it's based on a novel that's already been written.

You can't just start filming.
Much planning has to go into the project well before you press the record button on your camera.

You have to "storyboard" the project first.
In what kinds of locations will the filming take place.
Which actors will be in each scene? How will they be positioned?
What support resources will you need?
What sequence of events is to take place at each scene?

IT'S THE SAME FOR PLANNING TO WRITE CODE !!!
What sequence of events is to take place at each phase of the program?
What support resources will you need?
Who are the actors? (Usually a human user --but not necessarily so)
... and so on

P.S. edit::: Here's a better search result: Storyboarding for Programmers

1

u/unhott 10h ago

hey buddy, we all get errors. you just gotta read them and research why it might happen.

1

u/EnvironmentalDot9131 8h ago

Thats a great waya

1

u/pythonQu 6h ago

I was once like you.Didnt think I could code and I looked at everyone else who could as having magical powers.

I learned Python with Eric Matthes Python Crash Course but you gotta do hands on exercises. Get comfortable with being uncomfortable, try to code everyday.

Once you get the basics, do Free Code Camp Python track since that'll test your theoretical knowledge by going through more in depth hands in exercises. Thats what I'm doing now and it's made me stronger.

Trust me, a year ago I didnt/couldn't pass one of the super fundamental exercises and now I'm 40% of the way completed through the track.

1

u/MrAngel2U 3h ago

I gave AI a prompt. Something like.... Teach me like im a young student in the 80s with no experience wanting to learn the foundations of programing; and pencil and paper approach before things get complicated.

It worked for me. Everyone has a different learning style.

1

u/kayonred 3h ago

I'm self taught in programming-java. No one has ever guided me or helped me outside the resources I used,books mainly. Moreover,I have the disadvantage of being in a third world country with poor power supply and poor internet. For education my degree was in accounting.   I wasn't pressured to learn programming. I was curious and simply wanted to know. What I did was: read many books, type in code compile, get it working. Continue reading, Continue practicing, wonder when I'd be able to create real commercial grade software. As u can see,I operated under a false assumption- that more knowledge would mean professionality and worse,that software would build itself. Also,I thought all software were written at a sitting, but i kept trying. Another misconception was that reading a book from cover to cover would mean I understand all the topics in it. Wrong

 I wrote small programs along the way, then 3 years in,an event happened that marked a milestone in my learning. My handheld calculator died, it was a pemdas calc, and I thought, I've been programming for all these while,why not write it? It was a scary thought, but I took up the challenge, I knew nothing about languageceesign or compiler theory and it's lingo but after much sweat- no help anywhere,I was able to create it all from first principle.   So what's the point, you don't have to know everything and get it all right before you begin. 2. Write programs. Write little programs that interest you alongside those the tutorials dictate. 3. You learn by doing, building stuffs and taking them apart. You need a curious mindset, a desire to know how things work an explorative mindset.

2 dec26

1

u/dnswblzo 2h ago

Look at the wiki for this subreddit, it has lots of resources:

https://www.reddit.com/r/learnpython/wiki/index

1

u/Danizn_2004 1h ago

Hola yo creo que podrías empezar a leer el libro amarillo de python donde sale una serpiente es un buen libro, como para un nivel intermedio-avanzado ya que te da las bases, lo leo cada que tengo tiempo, pero la verdad es que si te va a servir pq es el contenido casi lo que se lleva o bueno lleve en una buena universidad aquí en Perú solo que 1 a 2 temas que no están en ese libro pero por lo demás muy completo. Eso leerlo pero con tu lap o PC al costado para que practiques mientras lees y aprenderás de forma práctica y leyendo por tu cuenta, saludos.

•

u/CowSniper97 53m ago

If you play PC and have Steam, give "The Farmer Was Replaced" a shot, its pretty fun and gives you practical problems to solve with code.

https://store.steampowered.com/app/2060160/The_Farmer_Was_Replaced/

-1

u/SecAdmin-1125 10h ago

Have you heard of AI? Use it! It’s a good tool to help you learn.

-1

u/Kit2love 7h ago

Ask Ai to teach you seriously

0

u/seanv507 10h ago

either work with online learning tools or use a coding agent(claude/copilot etc) . this will unblock you, can explain problems

-1

u/flameater 8h ago

Try flameater.wordpress.com

0

u/kayonred 3h ago

Have u tried books? They're more thorough and comprehensive than videos or websites  2 dec 26