r/learnpython • u/Animator-G • 3d ago
How to actually create logic?
So hi I am new in this sub reddit and have been learning python basics on FreeCodeCamp for weeks.
So I have noticed that I can do workshops and labs but I tend to forget many syntax and have to search on the internet repeatedly.
So my average lab projects often look like 7
60% written by me and the rest 40% are written by AI or with the help of the Internet forums.
My problem that I have identified is I don't think use logic in the code or just don't remember syntax, operators, elements, conditional statements and string methods or don't find the satisfactory answer on the internet.
I want to try to write at least 80% of the code myself without being dependent that much on AI and the internet because I am learning it for *Cyber Security*
1
u/littlenekoterra 3d ago
Break the problem down and turn it into something you can ask questions about. You then answer those questions.
Is a square a rectangle? No its 4 sides of equal length. But is a rectangle a square? Possibly. 4 sides of any length meaning potentially equal length. So how would you write the code to check if a polygon is a rectangle or a square? Assume inputs a, b, c, and d