r/AskProgrammers • u/Mammoth-Ebb4342 • 11h ago
Python
I need to be able to code with python for my a-level comp sci exams in 2028 that I just started but i'm finding it honestly pretty difficult.
Anyone got any tips for being more profficient/ learning better.
And just any tips to be able to code better at all.
2
Upvotes
4
u/iqisoverrated 11h ago
Practice. No one starts out being proficient at coding. It's simply doing more and more complex exercises (and preferrably at some point implementing something you want to implement) and reading the language definition.
2
u/BrannyBee 11h ago
The answer isn't fun to hear, but its literally just practice. Build lots of things, then build those same things again but better, then do it again. Then build things you've already built before, but slightly more complicated and incorporating new stuff, whether it be patterns you've learned or entirely new concepts.
You learned Hello World. You can read Hello World. That diesnt mean you should move on to the next thing, it means you now have that in your backpocket as something to keep practicing. After mastering Hello World, play with it, break it, see what it does. You can make your Hello World app print something new but just logically understanding that stuff in the quotes gets printed. You arent able to build just one thing after learning Hello World. You learned Hello Friend, Goodbye World, [insert anything here], etc etc. What happens if you type out the code for hello world 3 times? Try it and see, stuff like that refines the basics.
Then when you learn conditionals and user input, you might make a basic text advanture game in class. Thats a good project and you should build it a bunch of times. But also go back to Hello World, ask the user to enter their name, and instead of Hello World, build Hello [users name]
Then you learn loops. You go back and make the text advanture game with a basic gsme loop this time. But you also go back and build Hello World again, but this time you use loops for a feature. Same thing for variables, make it without hardcoding a string, stuff like that.
The fact of the matter is, is that coding is actually really easy. But its easy in the same way typing without looking at the keyboard is easy.... you probably dont even think about it, but when you first learned how to do it, it might have been uncomfortable to keep your hands on the keyboard home row, and pressing certain keys with certain fingers might have felt like a waste of time learning how to do.
More experienced devs read code and write it, and to you it seems like theyre all geniuses. That would be like if someone watched you type at 100wpm and thought you were a genius for being able to do it. You arent. And Im a fucking idiot and can read/write code a lot better than you. Its just repetition everyday for a long time til its automatic. Do it slow at first, and look up the answers when you need to, but you gotta keep doing it over and over again til you stop needing to look up the answers as often. Then its just like typing out a comment on reddit.
The real annoying part is you gotta force yourself to "go to the gym" and do it a lot, which makes it seem harder than learning to type without looking at the keyboard... but what you have to recognize, is that every bit of time you spend writing essays in school, talking to people on discord or playing video games, or just wasting time online is time you're unintentionally practicing touch typing.
So maybe you had a class in school where you spent a semester learning how to type properly. Withiut realizing it though, you practiced that skill every single day outside of class, you didnt just spend a single class period learning that skill. You don't code on discord when you talk to your friends or make reddit comments, you type... the big difference is you need to get as much practice as you can the same way you learned how to type, while recognizing how much you truly "practiced" learning to type outside of class, and force yourself to practice
Eventually though, coding stops taking up brain power abd program becomes all about puzzle solving and building stuff. Because all your brain power is spent on on that stuff, and the actual writing and reading code is easy and automatic. Then practicing programming becomes a lot kore fun, because the practice doesnt feel like homework anymore, just like how playing a video game doesnt feel like practicing touch typing
2
u/pvera 11h ago
Learn how to program, not how to memorize one language.
1
u/Human-Cellist-1059 10h ago
Find small codebases on github Even if they are small scripts. Read them, make sure you understand the code itself and why its written that way. Then expand the functionality little by little.
I found this a lot easier than tutorial he'll (once you know a little of the basics).
1
u/mkhanwrites_ 8h ago
Find exercises/coding problems to train your Python mind
1
u/Silver_Solution5782 7h ago
This is a well-structured introduction to Python. The explanation of its readability is particularly important for new programmers.
1
u/NefariousnessOwn8377 7h ago
Find something that you want to create or have your computer do, but start small
1
u/Fantastic_Rub_677 7h ago
Honestly, the best way to get better at Python is to actually write code every day, even if it's just 20 minutes... Start with small projects, practice loops, functions and lists, and don't just copy tutorials.
1
u/burlingk 5h ago
A couple of years is time to learn.
When you just start it's normal for it to be hard.
1
u/nacnud_uk 1h ago
Type. You must type, if it's what you want. Make the things that make you happy. And type. And type some more. Break the problems down, piece by piece. And type. Did I mention, type? And run and test and do the loop.
You can only get better by doing.
Or, hint, save your time and just get AI to do it all for you. You have options.
0
u/Top-Butterscotch5907 10h ago
write code by hand not by computer