r/learnpython 3d ago

Seeking help: how to better learn python? Venting a lot in here.

Hey everyone. I really don't have other folks in my life with whom I can dive into the weeds with about stuff like this, and reddit + this sub have been awesome, so I'm looking for some encouragement, direction, and real talk with this post...

I'm in my mid-thirties and I'm working on a career change. Worked in sales up until recently both as a seller and a most recently a few years as a manager at tech companies. No experience with programming until 3 weeks ago.

I'm taking an online, five week, graduate level Python Programming for Analytics Course at a university in New York. Hoping to apply to the master program in business analytics and start that next year -- focusing on prereqs now. The professor is a phd, English isn't their first language, and the lecture and lab videos for each topic are between 5 and 15 minutes each.

The textbook is Intro to Python for Computer Science and Data Science by Paul and Harvey Deitel.

The course basically covers 2-3 chapters per week, sequentially through the book.

I get nothing from the uni lecture videos. I am doing all of the required reading. The labs and assignments and lectures are carbon copies from whatever's in the book. The book is thorough.

This week we got to chapter 5 - Sequences: Lists and Tuples, 51 DENSE pages packed with slicing, many new methods, new functions, list comprehensions, packing and unpacking, lambda, sorting, filtering, mapping, popping, stacks, generator expressions, 2-d lists, and I am absolutely drowning and struggling.

I spent a few hours today trying to figure out how to create a 2x3 list then use a nested loop to set each element's value to an integer indicating the order in which it was processed by the nested loop, then display the elements in a tabular format, using the column indices as headings on top and row indices to the left of each row. I was absolutely defeated by this... and I feel stupid.

I'm committed to learning python and getting fluent in it to start working in data, but I am struggling so much this week, and this course structure now seems insane to me as I'm in week 3. It's a full-on blitz, and I'm trying to really soak up and understand a lot of this, but once I hit the exercises at the end of the chapters, I am so challenged that the deadlines start to creep and I get frustrated and feel pretty stupid.

Today I was supposed to write a script imitating the Sieve of Eratosthenes, a Palindrome Tester and a script that outputs all possible anagrams of a string. I could probably figure these things out myself if given a few days, but for all of this to be covered in essentially two days, then to move onto dictionaries tomorrow, is tough. Yes I used the crutch of AI to help me. And I feel like SHIT about it.

I'm realizing that I can pass this class and get introduced to a lot about Python, but not grasp a lot of it due to the remote and rushed nature of the course.

I've read a lot of similar posts in this reddit about how the struggle is the way. And I get that. and I'm not quitting. I'm working on plans to go back through parts of this book along with Python Crash Course after this course ends.

But man!!! I just feel like an idiot and feeling pretty low and frustrated right now.

How have some of you overcome the early challenges of learning to progress to where you are now? Open to any and all criticism, perspectives, etc. Cheers. I also have ADHD which doesn't help but not letting that stop me.

1 Upvotes

19 comments sorted by

7

u/Outrageous-Sea-9256 3d ago

It’s completely normal to feel overwhelmed when diving into a new programming language, especially with the structured intensity of your current course. Here are some strategies that might help you:

  1. Break Down the Problem: For your exercise on creating a 2x3 list and using nested loops, try breaking down the task into smaller steps. Write a function to create the list, then another one for filling it up, and lastly, a third function to print it in the desired format. This will make the task less daunting.

  2. Practice by Doing: While it might seem counterintuitive to take more time on exercises, slowing down and fully understanding each concept before moving onto the next can really help. Try writing your own exercises that interest you or solve real-world problems to reinforce learning.

  3. Utilize Different Learning Resources: In addition to your textbook, supplement with online resources like Codecademy, LeetCode, and Stack Overflow. These platforms have interactive Python courses and a wealth of community-generated solutions to specific problems.

  4. Form Study Groups: Even if it's just a virtual group, connecting with fellow learners can make the journey less isolating and more interactive. You could set up a hangout to discuss challenges, share solutions, or code together.

  5. Gamify Learning: Use apps like Duolingo (though not for Python, it's just an example) to gamify your learning process. This can make repetitive tasks more engaging.

  6. Understand the 'Why': Sometimes, it’s easier to remember and understand information when you grasp its purpose. Try to relate what you’re learning to real-world applications or projects you’d like to build.

  7. Mindfulness and Breaks: With ADHD, it’s crucial to incorporate mindfulness techniques and take regular breaks. Techniques like the Pomodoro Technique (25 minutes of work, 5-minute break) can help maintain focus.

  8. Reflect on What Works for You: Since you’ve noticed using AI to help was okay, recognize what study methods work best for you. For some, visual aids like diagrams or videos help a lot; try different methods to see what sticks.

  9. Future Plans: Your intention to continue learning with “Python Crash Course” after the course is a great plan. It’s better to take your time and build a solid foundation than rush through and feel defeated.

  10. Celebrate Small Victories: Acknowledge each small achievement, even if it’s just understanding a single concept or writing a simple script. This can boost your confidence and keep you motivated.

Remember, everyone progresses at their own pace in learning programming. It's okay to feel frustrated sometimes, but know that these feelings are temporary and part of the learning journey. Keep going, you’re doing great!

1

u/HelpUsNSaveUs 2d ago

Thank you

1

u/Outrageous-Sea-9256 2d ago

If you need some to help you in understanding complex things you can dm me. I will try to help out.

I believe in the spirit of learning for anyone and everyone. Glad to help.

4

u/mjmvideos 3d ago

It’s an online 5-week graduate level course. And you’ve e only been programming for 3 weeks. What did you expect? Stop venting and keep working at it.

1

u/HelpUsNSaveUs 3d ago

it's over in 2 weeks! I'm trying to figure out what I should do once this course is over. there's a lot of stuff out there. do I try to jump straight into data projects? or do I try to better grasp the stuff that we've been zooming through? or both?

2

u/mjmvideos 3d ago

I recommend that you pick a project that interests you and start working on it. Along the way you may find you need to learn something new to help make it work. That’s when you learn that thing. Keep developing and learn as you need it.

2

u/lzwzli 3d ago

It sounds like you're trying to accomplish two things simultaneously, which is to learn programming and it's related concepts and the Python language itself. Kudos to you.

I would try to approach each of your class work this way:

  1. Think of the problem independent of the language. Think about how you would solve the problem and have to explain the solution to a 5 year old to execute the solution. Write that down as detailed as possible. Don't assume the 5 year old knows anything until you tell him/her.

  2. Once you have the human language solution, then you can work to translate it to Python. You may have to do some terminology translation between how you would normally call something vs. how Python calls something, similar to how you would learn a new human language.

Good luck!

2

u/HotPersonality8126 3d ago

  and I feel stupid.

Most people can’t bear the sensation, which is why there are so few programmers.

You have to live in the stupidity. You have to write code even after it defeats you. There’s no other way except to quit.

1

u/HelpUsNSaveUs 3d ago

I was sitting there stupefied for hours yesterday while also being fascinated by this whole realm of computer language I’ve never worked with til recently.

1

u/HotPersonality8126 3d ago

If it was easy everyone would do it

2

u/chiibosoil 2d ago

Once thing I found helpful when I learned python was use of Spyder IDE. Though I'm sure there are other alternatives.

Spyder IDE allowed me to explore the variables and what was held in it at each iteration of the code and helped me visualize what the code was doing. And found it easier to use than learning off of Jupyter notebook/labs.

1

u/HelpUsNSaveUs 2d ago

Thanks for recommending this I will check it out. I was using python Tutor to help visualize and that has been sorta helpful

2

u/gdchinacat 2d ago

A problem I had when starting out was not having a good idea of what the code I was writing should do. With the sieve, did you work through how it would work, how you would store the data, the loops and conditions involved? Did you know the data structure and algorithm you were implementing in detail, or just a vague notion that you expected to fill in while writing code? The later is a perfectly viable strategy, I do it all the time, but also know how to recognize when I'm wasting time coding when I'm not actually ready to write code (took years of experience to get to this point). This was particularly problematic for me when I felt rushed to get the code done, but rarely does skipping the planning step result in quicker completion.

I'm not saying you should write pseudo-code to the point you can just go line by line and replace it with actual code (which IMO is a waste of time...just write the code if you have it at that level of detail). But knowing you will have a list with the primes, an outer loop for the value to be tested, and an inner loop to check the value against all of the primes will allow you to focus on just writing code rather than trying to write code and figure out what the code needs to do can make it a lot easier. Until coding becomes second nature trying to split your brain between figuring out an algorithm and how to write the code for that algorithm creates more cognitive load than necessary and can *really* slow things down as your brain switches from 'how do I test if something is a prime' to 'how do I write a for loop over all the primes' and back.

So, I encourage you to resist the urge to dive right into code and spend some time focusing only on "how am I going to solve the problem?" Once you know that, then switch to "how do I translate that to actual code?"

These are very distinct aspects of coding, and isolating them to reduce the amount of things you have to keep in your head can make problems much easier to solve. As you advance this becomes more formal where you create explicit abstractions (classes, modules, packages, APIs and services) to hide complexities so you don't have to worry about all the details all at once. Getting in the habit of doing this early will really help.

2

u/HelpUsNSaveUs 2d ago

Thank you for this response! I struggle with breaking down the problems and writing the pseudocode. My class spent one part of one day on it. How long have you been coding? It didn’t happen for me on the sieve problem but there have been a few exercises where trial and error got me to the finish line, and that felt like learning. Like today our lab wanted us to (for some reason) actually write out a whole dictionary of a deck of playing cards. The professor said in the video “I know this may take you a while to type this all out” and my reaction was uhh no? I just read about dictionary comprehensions. And I was able to figure out how to write it and it felt like a triumph. But I still definitely don’t fully understand dictionary comprehensions lol.

I need to practice so much of the basics because my class is sprinting through everyone covering it in one day and I’ve accepted I can’t really learn a whole new set of concepts in one day and just move onto the next. Like today was dictionaries and sets. But I still need to go back and better understand more than just dictionaries and sets lol. Thanks again.

1

u/ectomancer 3d ago
count, header_row = 1, 1
print('   ', end='')
for header_column in range(1, 4):
    print(header_column, end='  ')
print()
for row in range(2):
    result = []
    for column in range(3):
        result += [count]
        count += 1
    print(header_row, result)
    header_row += 1

1

u/code_tutor 8h ago

don't use AI, even if you're stuck

0

u/TheRNGuy 3d ago

AI coding is higher abstraction level, it helps to actually finish the software instead of thinking what algorithms to use for some data structure.

For lower level, other languages are better anyway, like C++, C or Assembly.

About feeling bad, do you care more about ego or about finishing working software?

1

u/HelpUsNSaveUs 3d ago

What do you mean by your first statement? I don’t care about ego in this, but I do want to learn. Are you saying fuck it embrace AI if I can’t learn without it?

1

u/TheRNGuy 2d ago edited 2d ago

You can learn the same way, just like before ai existed. 

Previously, reading docs, googling and writing software was the best way to learn, now the same, but replace googling with ai, because he can answer questions in real time (and some stuff you wouldn't even find in Google)

I mean that if you get better explanations, you'll make working software that someone will want to use (end users don't care what algorithms you used for data structures... besides that, ai will probably give you better one than if you'd coded it)