r/learnpython • • Jul 18 '25

Help me please I can't code!

Hey fellas ! I started learning coding 2 week back , I'm a non math kid so i tried learning python from scratch and i was learning things like operators data types functions if else elif loops etc .. than i started write codes those task code which my online yt teacher asked us to do but I can't code tht like I can't create logic on my own thn I used to watch the answer thn I think man i could have done tht it's so easy I'm dumb it's like I know what python syntax is everything about it but I can't code on my own other than some simple stuff. Should I drop it? Or carry on ? It's been 2 weeks I have watched around 10hrs of content... please help me.

0 Upvotes

46 comments sorted by

View all comments

2

u/jbourne56 Jul 18 '25

Do you quit hard things so quickly typically? You just started and want to give up. Doesn't seem like you're cut out for programming or analytical work where you have to struggle some to figure out answers.

1

u/Impossible-Budget371 Jul 18 '25

Yeah bcz i can't understand the logic and how I can solve it recently I was asked to solve a question where it was like

User will enter no of legs and heads as input

U have to count no of dogs and hens Dogs - 1 head 4 legs Hens 1 head 2 legs

I was blank man .. I'm learning it from past 2 week

0

u/Zormuche Jul 18 '25

That seems more like a math problem than a programming problem

0

u/theWyzzerd Jul 18 '25

Programming is literally math.  Even when it isn’t, it is.

0

u/Zormuche Jul 18 '25

I disagree, and I meant that this is just a math problem that you'd work out on a paper to get a formula, then just write that formula in python

0

u/theWyzzerd Jul 19 '25

Every aspect of programming you take for granted is rooted in math, even putting aside the fact that it all gets translated into literal Boolean logic at the lowest level. 

What do you think an algorithm is, exactly?

Control flow is Boolean logic. 

For loops?  Mathematical induction.

OOP? Abstract algebra.

Functions? Also abstract algebra. 

Binary search?  discrete math.

Data structures? Set and graph theory

  Combine them and you get an algorithm, which is literally defined as “a procedure for solving a mathematical problem.”

We use mathematical concepts and ideas in every aspect of programming, literally every single one.  You can disagree, but you look a bit silly when you do.

0

u/Zormuche Jul 19 '25

But the point is not to be arrogant but to be relevant. I have a degree in computational mathematics, I know all that. But we're talking about a beginner programmer trying to solve litteral equations here

0

u/theWyzzerd Jul 19 '25

And telling someone that the coding challenge they were given “just sounds like a math problem” is very fucking helpful to them, I’m sure.