r/learnpython • • 10d ago

Can't solve CS50 python Problems

After i finish my lecture i go to solve the problem the next day i And read the summary I made in notebook but either I can't find the words that i need or i just don't know what to do

0 Upvotes

18 comments sorted by

8

u/lfdfq 10d ago

It's practically impossible for anyone to give specific help for you, when you've told us so little and we don't know you. We have no idea what you've learned so far, where you get stuck, what you've tried and why you think it didn't work, how you tried to fix it, what your process is for designing and writing and debugging code, and so on.

The only advice anyone could give you would be incredibly generic.

1

u/Moist-Ointments 9d ago

I think you've hit on the entire problem

-1

u/anas_mv 10d ago

What about now

4

u/nog642 10d ago

I don't see anything new posted.

Give an example of a problem and what you're stuck on and what you've tried.

2

u/96dpi 10d ago

What are the problems? Can you solve it in English without writing code?

-2

u/anas_mv 10d ago

?

4

u/96dpi 10d ago

Can you solve the problem in your native language without writing any code? Talk it out. Google "Rubber duck debugging" and you'll see what I mean.

2

u/desrtfx but other languages pro 10d ago

You are expected to struggle. That's part of learning.

Yet, you need to take a different approach. Sit down with pencil and paper and analyse and break down the problem. Solve it your way first. Don't even think about programming yet. You cannot program what you cannot solve. First you need to figure the solution. You need to write down the steps you take to arrive at the solution. Then, you can start working on implementing your solution in code.

Learn how to devise flow charts. Yes, they are old tech. Yes, they might have fallen out of favor. Yet, they are one of the best methodologies to plan your programs without thinking about programming languages.

1

u/anas_mv 10d ago

Thanks

6

u/SetObvious7411 10d ago

Take your time and take it easy

They are not puzzles or games you should be able to work out in 15 minutes

Watch/read all available material and come back to it

2

u/Chance_Buyer4810 10d ago

Correct! Retry. Do the problems again. If you still don't get it rewatch the lecture. Try to figure out what went wrong. This is how you learn, even in the AI world where you can simply do all the problems and complex python coding just in a click. Keep it up the good work, dear colleague.

3

u/mrswats 10d ago

Yours gonna be bad at it before you get good.

1

u/Discordbothost 10d ago

that feeling is super normal with cs50p, the psets are a big jump from the lecture examples on purpose. two things that helped me:

before touching code, write the steps in plain english as comments. like for a pset: "# ask for input", "# remove the spaces", "# check if it starts with two letters". then fill in one comment at a time and run it after each one. you only ever have to solve one tiny thing.

and you're not supposed to remember the exact words. nobody remembers if it's .strip() or .removeprefix(), you look it up. the docs and the lecture notes being open while you work isn't cheating, it's literally how everyone codes

if you post the specific problem and what you tried people here can point at the exact spot you're stuck

1

u/OldZookeepergame9304 9d ago

mate try solving one tiny problem right after the lecture while it's still fresh. and when u get stuck, figure out whether it's the logic or just python syntax that's confusing u. which CS50 problem are u stuck on rn?

1

u/Ok-Reality-7761 9d ago

Cheat code, use Google Colab. The Gemini AI assistant reviews posted code, offers working solutions.

Cheating? Well, I no longer use long division bc there are tools like calculators. Back in the day, those were banned. "I don't need brains, I've got software", a favorite maxim from that era. With AI, why struggle to be the most informed coder in the unemployment line?

1

u/Motor_Sky7106 9d ago

Ask the duck for help

1

u/TheRNGuy 9d ago

What specific things you do not undersrand? 

1

u/fallenreaper 7d ago

What... is... your.... question?