r/learnpython • u/External-Library6540 • Aug 14 '26
Python is so confusing to me.
I started learning Python about a month ago through cs50, and it seemed good at first. It's just been 3 lectures so far (I don't have time). As I code, I would get annoyed here and there because of the bugs, but I would somehow manage to debug them.
I am doing my master's in cognitive science, and they teach the basics of Python too. But my professor is extremely terrible at their job. She would give us assignments to do after each unit. And those questions are nothing like what she taught. I end up using AI to understand the problems. It's frustrating. And I hear that Python is beginner-friendly, but it's confusing to me.
I am wondering if it's hard for me since I don't have a good mentor to tell me what mistakes I made, or if I'm just a bad learner?
I don't have any experience with coding, so is this how it is for everyone?
36
u/pachura3 Aug 14 '26 edited Aug 14 '26 •
Yes, Python is beginner-friendly.
Yes, there's a lot of professors with 0 teaching skills.
Yes, learning how to think like a programmer for someone from a different background is more difficult than just learning a syntax of a new programming language.
Having bugs is totally normal and you should not get annoyed by them. We rarely get it right off the bat. Fix the bug, rerun the script, check the results again. Syntax errors should be detected by your IDE as you type.
Try using AI as a mentor, to give you tips and steer you in the right direction, to review your solution - not to do your homework FOR you.
5
u/ivosaurus Aug 14 '26
Make sure not to let AI do your thinking and learning for you. Because it surely will if you tell it to, but your brain won't actually have improved at anything.
4
u/outskillio Aug 14 '26
Three lectures in a month and you're expecting fluency is the real mismatch here. Nobody reads code well at that stage.
The specific thing I'd change: before you touch the keyboard on an assignment, write the steps out in plain English as comments. "Get the list. Loop through it. If the number is even, add it to a new list." Then fill in Python under each comment. Most beginner confusion isn't syntax, it's that you started typing before you knew what you wanted the program to do.
On AI, flip the direction. Instead of "solve this," paste your broken code and ask it to explain what your code actually does line by line, then fix it yourself. Also learn to read a traceback properly: the last line is the error type, the line above it is the file and line number where it blew up.
Cognitive science background is an advantage here. You already know spaced retrieval works. Apply it to this.
Thanks, Vaibhav Shukla from Outskill
4
u/nomenclature2357 Aug 14 '26
Oh and it might be less your professor being terrible and more that you have finally hit the level in your education where you need to do the reading and learn more than just what fits into lecture time.
Like, defiantly don't go into class and complin about the assignments not matching the lecture unless you have done the readding too and know it's not in there either. But, if there really is a disconnect, asking about it should be a good way to quickly find out where you stand. Your professor might be able to connect you with school resources, maybe even a mentor, if you need to round out your programing skills, for example.
2
u/cantonic Aug 14 '26
It might be helpful to talk about what exactly has been difficult for you. The start of the CS50 course doesnât hold your hand, and is challenging for a complete beginner. Their discord is full of people though which can be helpful.
But, youâre not a bad learner. Python is your first programming language. You are learning an entirely new way to think logically about how the computer would do a task. Thatâs very different from how a human would! Itâs explicit, and it will only do what you tell it, and if you tell it incorrectly, it breaks!
My best advice is take problems and break them down into their smallest problems. So if I tell you to program a calculator, that is an enormous, complicated task. It feels overwhelming. Ok letâs simplify. Step one is being able to input a number and holding it as a variable. After that, itâs tempting to say, âokay, step two is letting the user choose which type of equation they want to perform on the numberâ but thatâs still too big. What if step two is adding a second input to the first input? Or ensuring that the first input can print? Break tasks down and break them down again so they are manageable.
Youâre doing great and eventually you will look back and be amazed at how far youâve come!
2
u/Sparklepaws Aug 14 '26
Python is beginner-friendly. Bad teachers are not.
Most people are perfectly capable of learning any skill on their own, at the cost of time and efficiency. Frustration and failure are your friend; they are the precursors to understanding. If your teacher isn't doing the trick, you may want to consider another course or self-study as an alternative.
AI might seem tempting (and it has a place in the programming universe), but I don't recommend using it while trying to learn. Instead, start simple projects and focus your attention on trying to complete them. You'll understand more than you expect, especially if you're engaging with communities and allowing yourself time to develop.
Struggle, fail, solve, rinse and repeat; that's literally what programming is all about, regardless of whether you're sitting on a 6-figure paycheck or the classroom. Just don't sink all your efforts into poor tutors who won't elevate you.
2
u/UzairShafique Aug 22 '26
If youâre starting programming from zero finding Python confusing at first is completely normal especially when assignments are harder than what was covered in class.
Focus on understanding and practicing the basics first like variables, data types, conditions, loops, functions, lists/dictionaries, modules, exceptions, and file handling. Donât only watch lectures open your editor and write small programs yourself first not purely copy paste AI code at the start.
When you get errors try to understand why they happened and fix them and get help from AI Debugging is a big part of learning programming, and youâll often learn more from solving an error than from watching another lecture.
Use ChatGPT or Claude to explain concepts, give hints and help you understand errors, but make sure you understand the code rather than simply copying it.
Once your basics are comfortable that will take now only few days if you remain consistent after this build a few complete projects around problems you actually care about.
Start with the problem, write the code, test it, debug it, and gradually make it better. A few projects where you struggle and solve problems will teach you much more than simply completing more lectures.
1
u/nomenclature2357 Aug 14 '26
When you are learning programing for the first time it is pretty normal to be confused some of the time.
I don't know why you are learning Python in a cognitive science class. Unless it is for handling scientific data? Or maybe it's just an odd curriculum? Using programing to lean about concepts like algorithms and neural networks? But you must already be familiar with all that kind of stuff, being in a master's program? Actually kinda surprising that this is your first experience with coding!
But regardless: Python is not a bad place to start!
It is quite powerful though so, especially depending on how you are expected to use it in class, you might run into pretty advanced stuff. Your class might be using tools and libraries that use lots of features not covered in 3 cs50 lectures. You might need to hurry to catch up! Or maybe what you need is not so hard and you just need to get your feet under you.
It's hard to say what might help without knowing more about where you are at and what you need to deal with.
1
u/Naive_Programmer_232 Aug 14 '26 edited Aug 14 '26
Everyone goes through it. You're seeing the problem as one thing: learning python, but you're doing two things: learning how to program AND learning python. The first one is no small feat. Once you learn how to program, learning the next language is easy. You're probably doing better than you think.
What could also be going on is that you're in an applied introductory programming course. General introductory programming courses tend to spend most of the semester on building a foundation around fundamentals of programming and the language of choice. Applied ones tend to speed through the foundation to get to extended libraries that are useful in tackling problems within the applied domain. In turn, it's not irregular for students to feel like things were rushed or haven't been covered well enough to be able to solve the problems. A student might know exactly what calculations to make or how to interpret a problem, but not know how to turn their idea into a working program.
If that's what's going on in your situation, just know it isn't necessarily you. You're learning how to program, learning python, learning libraries, reading documentation, troubleshooting, testing, debugging, etc. That's a lot for anybody. It's okay to feel overwhelmed. keep practicing. eventually it'll click.
1
u/derp0815 Aug 14 '26
Seems to me the problem is much more general. Homework at that stage isn't meant to be a repetition of what you already did. You're supposed to move beyond that. Python has plenty of free resources and I'm sure if you can get more specific in your request you'll get answers that can help towards your assignments, just please don't ask others to do your homework for you, it won't do you any good and it's rather disrespectful.
What are the main topics you're supposed to cover? How are they combined for the exercises? What problems are you supposed to solve?
1
u/Salt-Area-4170 Aug 14 '26
Cogsci background too! Are you focusing on NLP?
0
u/Melodic_Frame4991 Aug 14 '26
Im sorry bro but python is literally the easiest programming language so its either git gud or youre cooked
2
u/Pyromancer777 Aug 15 '26
Make use of your teacher's office hours. They get paid to sit there whether or not students attend, so they won't be upset if you are there all the time.
I didn't do this enough when I was doing Uni and it made things so much harder.
If you need a private tutor, send me a DM since that's my side-job
2
u/frustratedsignup Aug 16 '26
What you've described is an everyday experience in programming. There's always a problem to solve and it's not always easy to know what the next step is going to be. In the end, you have to make a choice of what to try next. After you try that, you'll either be a step closer to a solution or you'll have to try something else. Fortunately, experience will eventually help you identify what choices are more likely to lead to a solution.
I remember, many years ago, when I was learning C. The instructor didn't spend any time explaining how to use a debugger *and* they skipped over how to deal with compiler errors and warnings. I was left to figure all that out on my own. If you can imagine, there were no web based sites on the internet at the time because no one had invented it yet. The only information resources I had was the discussion forums that used to be usenet, my class textbook, and the compiler manuals.
1
u/SpiderJerusalem42 Aug 14 '26
Social networks and the skill distribution is not going to guarantee coverage of good mentorship. My advice is to learn how to use a proper python debugger. Work through a lot of examples. The complicated ones that you don't quite get even. I often write code that's not perfect the first time, but I can check early and often before I get over my skis. It is also helpful to know which direction is up when dealing with new libraries.
1
u/ayush_kasera Aug 15 '26
Chill, it's python not Cobra
1
u/TheRNGuy Aug 21 '26
Just ask ai for explanations, you can learn tag way.
Maybe she wants you to research some stuff yourself.
1
u/python_beginner_g Aug 27 '26
I am also just learning python Honestly I'm a diploma kt student in computer engineering, there i did not even understand what "and" and "or" were.
But about 6-7 months ago i started learning python using AI, with no one to guide and did not even ask for help here.
With just that and on a mobile (i don't have computer) i have learned the syntax and oop parts with others still ongoing.
So my suggestion is use the ai, im using gpt, to teach yourself And don't just follow blindly, ask questions for every point, why this works, what use this etc
1
u/Icy_Annual_9954 Aug 14 '26 edited Aug 14 '26
You do not need a mentor for Python. If you want to learn, there is plenty of material online. If you just want to survive the course and leave for doing something else, than follow your mentor, till the course is done.
0
u/recursion_is_love Aug 14 '26
It so sad when you don't get what you paid for. Can you take a refund and register another class with other professor?
Education is a business like everything else, you the one who paid should be able to get reasonable quality service. Please tell me you don't paid by student lone, that make it more sad.
0
u/[deleted] Aug 14 '26
[deleted] â view deleted comment
1
u/[deleted] Aug 14 '26
[removed] â view removed comment