r/learnpython • • 2d ago

5 months into Python: stuck on problem solving and struggling to focus. How do I improve?

Hi everyone,

I've been learning Python for about 5 months. I know basics like data types, lists and classes, but I still can't solve problems on HackerRank. When I get a problem, my mind often goes blank. Sometimes I also struggle to understand the statement in English.

I spent the last 3 years consuming a lot of mindless social media content. Now I find it hard to focus and stay disciplined, and reading documentation or books feels difficult.

I'd like advice on:

  1. How can I build logical thinking and problem-solving skills?
  2. How do I get past the "blank mind" stage?
  3. How can I rebuild my focus and discipline?
  4. How can I get better at reading documentation and books?

If you've been through something similar, what actually worked for you?

Honest feedback is welcome. Thanks!

3 Upvotes

20 comments sorted by

6

u/True_Room3265 2d ago

Hey, buddy! 🥹

I think you might benefit from changing your approach a little. Instead of focusing primarily on HackerRank, why not try building a small Python project that solves a real problem you personally care about? 🙂

First, ask yourself:

"What is one repetitive, inconvenient, or frustrating problem in my daily life that I wish I could solve?"

It could be organizing files, tracking expenses, managing study schedules, or automating something you repeatedly do.

Once you've identified that problem, try this:

  1. Define the problem. What exactly needs solving? Who benefits from the solution?
  2. Break it into smaller tasks. Describe the steps in plain English or your native language before writing Python.
  3. Build a tiny MVP. Start with the simplest working version. Don't worry about fancy interfaces or advanced features.
  4. Learn concepts as you need them. If your project requires dictionaries, functions, file handling, or databases, study those concepts and immediately apply them.
  5. Test and improve. Try different inputs, investigate errors, and gradually add features.

This is also a practical way to develop logical thinking. You're repeatedly practicing how to decompose a larger problem into smaller, manageable steps.

For HackerRank, I'd suggest writing down the inputs, expected outputs, and a simple example before touching the keyboard. If the English wording is difficult, rewrite the problem in simpler language or translate it first. Understanding the requirements is part of solving the problem.

For focus, start with manageable 20–25-minute sessions. Put your phone away, work toward one specific objective, and take a short break. Gradually increase your reading and coding time rather than forcing yourself into marathon sessions.

For documentation, don't feel obligated to read entire manuals. Start with the section relevant to your current task, run the examples, modify them, and take short notes.

Most importantly, don't measure your progress only by how many HackerRank problems you solve.

Learning Python syntax and learning how to solve problems with Python are related, but different skills.

At five months, you have plenty of room to grow. Build something small, make mistakes, debug it, and improve it. Those experiences are valuable.

I'm curious: What's one real-life problem you'd genuinely enjoy solving with Python? Start there. 😊

2

u/Guilty-Question-6557 2d ago

thanks for help. I will try today

2

u/seanv507 2d ago

Another approach is Learn X the hard way.

Basically the idea is to memorise the basics by writing lots of code. Then when you come to a new problem you can on your memories

https://ptgmedia.pearsoncmg.com/images/9780321884916/samplepages/9780321884916.pdf

1

u/Guilty-Question-6557 2d ago

thanks for help. i will read it

2

u/sporbywg 2d ago

Turn inside; you give power to externals as a habit.

1

u/Guilty-Question-6557 2d ago

thanks for help

2

u/Top-Cauliflower-1808 2d ago

The blank mind is not a Python problem. It is a focus problem from three years of short content. Stop HackerRank for a month and read one page of documentation daily. That is the real fix.

1

u/Guilty-Question-6557 2d ago

thanks for help

1

u/Senior-Ad-6588 2d ago

Stop watching tutorials and start building stuff, start with basic games like number guesser, slot machine etc

1

u/Guilty-Question-6557 2d ago

thanks for help

1

u/hyper662 2d ago

bhai phele hii HackerRank pe mat kro phele logic build kro... 1.Code likhne se phele dry run kro and khudse pucho question kya mang raha and question ko kaise solve kru jaise ki loops se star program print krna... question dekhte hii computer me code likhne mat jao phele dry run and socho kaise kru 2. ye apne aap chala jayega jab tum chote chote logic problems build karoge 3. just leave doom scrolling and always try to watch long videos apne aap thik ho jayega 4.dont try everything at once... sab chiz ek sath kroge toh dimag hang ho jayega dhire dhire sab kro just start with daily 2-3 pages after 5 days or 1 week increase the number of pages

1

u/Guilty-Question-6557 2d ago

Thanks for help

2

u/TheRNGuy 2d ago

Experience. 

2

u/Crazy-Willingness951 2d ago

Transforming requirements into code is the essence of programming. My favorite method for doing this is Object Oriented Analysis and Design, coupled with Test Driven Development.

2

u/ytreplacementenjoyer 2d ago

As others have already suggested, try to build projects - take all the help you need. Even AI, if needed. Pick a few domains of your choice; it can be anything - web dev, database engineering, DevOPs, ML/DL/RL, optimization or anything else. Try to look for resources online, AI would help. Programming (in any language) is so much more than Hackerrank/Leetcode grind. Most companies use DS/Algo problems as a filter to narrow down their candidate lists. You would be using very little of it (if any) in your job.

Now, if you want to get better at solving Leetcode/Hackerrank problems or competitive coding you would definitely need to learn certain "techniques" and "algorithms" from somewhere. You would find a lot of free resources on YouTube. You can also try books (if you prefer reading books, that is). Always keep in mind that problems based on data structures/algorithms have a steep learning curve and you are only 5 months in! You are not expected to handle the most challenging problems on your own just yet. Just trust yourself. Additionally, try to get better at intermediate level mathematics - especially discrete maths topics and graph theory. That would help.

1

u/shannonpieter 1d ago

Your mind going blank on HackerRank after 5 months is really common: knowing lists and classes is a different skill from turning a problem into steps. One thing that helps: before writing any code, write the steps in plain words as comments (in your own language is fine), solve it by hand with a tiny example input, and only then translate each step into Python. Stick to the Easy problems, give yourself max 20 minutes before reading a solution, and re-solve that same problem the next day without looking.

Which kind of problem makes you go blank most: string/list manipulation, or the ones with a loop inside a loop?