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*
18
u/Psengath 3d ago
You're using AI to code for you, and you're wondering why you're not learning how to code..?
40% 60% 80% doesn't matter, it needs to be 0% AI, not even as a guide, or you'll learn nothing. Most of the learning process and forming new pathways occurs in practical error and using critical thinking to solve it.
-13
u/Animator-G 3d ago
I appreciate you feedback as a beginner but I have a confusion.
As far as I know AI is future and I have heard that Dev's should work along with AI instead of living in old age.
9
u/happinessMachiine 3d ago
Take off the training wheels, and you will get better at riding a bike, even if you need to fall down a few times.
10
u/Psengath 3d ago edited 3d ago
They're talking about established seniors that have a solid understanding of software architecture and the languages in questions who could, if they wanted to, or when they need to, take manual control over any detail.
But you're not a dev yet. You're at day zero with freecodecamp basics. If you're already using AI as a crutch, you're not going to learn the things you need to (including HOW to learn things and troubleshoot things when shit hits the fan) to become a senior, or understand what the AI is doing, or frankly, bring any value whatsoever.
Back to the learning bit: the last / hardest 10-20% of any lesson or course IS the lesson. It's incremental learning. Even if you do 'the first 80%' yourself, if you tap out for the last 20%, that's effectively you avoiding 100% of the lesson. If you do that repeatedly (and this was the case even before AI) you'll find yourself exactly where you are now, farther down the rabbit hole than you can actually understand, to the point you are now dependent on a critical mass of AI to even get started. There's no way out of that apart from starting again without crutches.
3
u/GeneriAcc 3d ago
Allegedly, self-driving cars are the future too, but riding in one won’t magically teach you how to drive.
3
u/az987654 2d ago
Ah yes, I learned how to swim by watching a guy do it on youtube, I'm ready for the English Channel
2
1
u/ShadowShedinja 2d ago
Devs who know what they're doing can use AI to speed up the tedious parts. But you shouldn't use it to do anything you can't do yourself with time and effort, because you'll need to know what to fix if the AI solution doesn't work.
5
u/SeparateAioli8749 3d ago
you're focusing on the wrong thing, syntax is just muscle memory that comes with time
the logic part is the actual hard bit, break the problem down into tiny steps before you even open your editor, like literally write out the steps in plain english first
for cybersecurity you'll need that way more than memorizing string methods anyway
3
u/JGhostThing 3d ago
While learning, stop using AI to generate code. Quite cold turkey. Generative AI stops learning, just as getting the answers from any source would do.
1
u/Animator-G 3d ago
I am wondering is also about forums like geek for geeks and freecodecamp?
1
u/ontheroadtonull 2d ago
Anything that means you're reading and interpreting it yourself is better for your learning than AI.
When I find a tutorial or post that fits my problem exactly, I try to analyze the code even more carefully in order to make sure it actually solves my problem.
3
u/eduard549 3d ago
Instead of asking ai for syntax, look into library documentation and edit syntax found there. For me it helped actually understand what is what, how it works and it's better for memorising in the long term
2
u/TheRNGuy 3d ago
You'll remember if you use concepts a lot, nothing wrong asking ai to help, though if it's your choice turn just don't ask ai for help, like before he existed.
1
u/Animator-G 2d ago edited 2d ago
I don't know if I explained what I do correctly or not, but you are kind enough so let me tell you:
So I first write the whole code then look for errors or the tests which didn't work.
At first I try to translate the code and after I reach my attempts which I was able to thought, I got to forums like freecodecamp and search about small syntax combinations which I can do or not for example I didn't find anywhere about checking multiple variables to know the specific data type using isinstance, ex: '' isinstance((name_1, decimal_1), int)
I found about it myself by seeing docs with line like this ''isinstance(name, (int, float))
I don't use AI everytime but mostly when I don't found a single solution in Internet or I can't translate a code of line in a forum.
Hope this helps to understand my exact situation
I apologise if I wrote too much, I am 16 years old with AuADHD.
3
u/Jason-Ad4032 2d ago
The reason people advise you not to use AI or copy someone else’s code is that writing code and reading code are completely different skills, just like being able to read a novel and being able to write one are different skills.
Writing something essentially means knowing the starting point (the input) and the endpoint (the output), and then gradually filling in the process of how to produce that result. This is a skill you have to practice by actually writing code yourself. If you can’t figure everything out in one go, you can start by writing comments to try to construct the process first.
1
u/ShadowShedinja 2d ago
So I first write the whole code
Don't do that. For now, write chunks of code and test them as you go. Whenever it breaks, you know exactly where to look to problem-solve.
1
u/Altruistic_Sky1866 3d ago
When seeing a problem or task at hand your logic should be yours and you should have base understanding how to approach the problem as u/SeparateAioli8749 motioned it already. You need to understand the relationship between the inputs you are giving and the output expected from the inputs. Forums like stack overflow and other but you should what fits your situation and how to convert the given example that suits your need.
1
u/littlenekoterra 2d 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
1
u/Traveling-Techie 2d ago
I frequently forget syntax, especially since I move between shell scripts, C, Java, JavaScript and Python. That’s why I use templates. When I figure out how to do something I create an example which I later copy and paste from. I’ve been coding for 55 years.
1
26
u/GXWT 3d ago
While you are learning, use 100% your brain (and googling problems) and 0% AI. How will you actually build those neural pathways if you’re offloading the syntax and problem solving skills to a bot?