4 ways to practice Python without following a tutorial


A person sitting in front of a computer with several laptops writing code. Credit: Elle Aon/Shutterstock.com

if you are learning pitonChances are you started with tutorials and honestly, there’s nothing wrong with that. They give you a solid foundation and help you get familiar with the basics. But at some point you can get stuck in a endless loop of hell tutorialThis cycle limits real progress without you realizing it. I’m two years in now and I’ve made enough mistakes to know which habits really make you better. These are the ones that are worth it.

Level up with code games: learn by playing

Stop reading about Python and start playing with it.

If you find traditional exercises a little difficult, Coding games are a better substitute.. I like this method because it turns learning from a passive activity, like watching lessons, into an active, goal-oriented challenge. You’re no longer simply writing code to complete an exercise, you’re now solving puzzles and defeating opponents to earn a higher ranking on the leaderboard.

If you’re just starting out, these three platforms are all you need: combat code, CodingGameand CheckiO. I started with codecombat and it was exactly what I needed in my early days in Python. It makes using Python easier by putting you inside a fantasy game where the only way to move your character, attack enemies, or unlock new levels is by writing real code. CodinGame is great if you like competition, it allows you to write Python code to battle other players in real time. CheckIO is more puzzle based and gets more difficult as you level up. All three are free to get started and each of them interests you more than the tutorials.

Build it again, but make it better

Your old code is your best practice material

A person sitting in front of a computer with several laptops writing code. Credit: Elle Aon/Shutterstock.com

Sometimes, it’s better to revisit your old projects than pursue new ones. You can go back to something you already built in the past. It doesn’t have to be impressive. A guessing game, a basic to-do list, a script that renames files – any project counts. Open the file on your PyCharm IDE and read it like a stranger. You might cringe a little, that’s a good sign, it means you’ve grown since you wrote it.

Now rebuild it with everything you know now, you can add new features, fix broken logic or just clean up code that works but looks like it was written in a hurry. Engaging in small improvements like these will teach you more than you could ever hope for. As you refactor, you develop an eye for writing quality code, which is an important marker of experience.

Become your own technical support

Automate the tasks you already do every day

A laptop with robotic arms that performs automated tasks Credit: Lucas Gouveia / Justin Duino / How-To Geek | elenabsl/ Shutterstock

One of the best-kept secrets of experienced Python developers is that they learn a lot of what they know by solving their own problems. Think about the small, repetitive tasks that consume your day. Maybe you manually sort files into folders, copy data between spreadsheets, or rename photos from your camera. These are exactly the types of problems Python was created to solve.

when you write a script that automates something you actually use, the motivation to make it work is real, because if it breaks, you feel it. You can write a script that organizes the files in your downloads folder by file type or one that sends you a morning reminder. It is not necessary to build something complex. What matters is that the problem is yours and the solution has to work. I once wrote a script that automatically deleted all the old screenshots that were cluttering my recycle bin. It took me about an hour to figure it out, but it saved me from doing the tedious cleaning manually every week.

This type of hands-on practice will develop your problem-solving instincts that no tutorial can replicate. I mean, Yes, you will make mistakes you have never seen before, read the documentation you would have skipped and find solutions on your own. That little process (find, fail, fix) is what will make you a better Python developer.

The best way to learn: start teaching someone else

You really don’t know until you can teach it.

You don’t have to be an expert before sharing your coding knowledge. In fact, teaching before you feel ready is when real learning happens. I had a group of friends at school, three of us were curious about programming. I usually explain something I learned, and almost always, they had a question I didn’t anticipate and that made me search for an answer. That process of searching, explaining and simplifying things is where deep understanding is built.

If you don’t have anyone to teach in person, writing counts too. Every time you put something into words, you gain a better understanding of the topic. You can start a blog, publish and document short explanations about redditor developer communities like dev.to. You’ll gain an audience of programmers like you, from whom you’ll also learn, contribute, and suggest better approaches.


Every line of code outside of a tutorial counts

To get better at writing Python code, you need to go beyond passive learning and start doing things that really challenge you. Sometimes these alternatives may not seem productive at the moment, but it all contributes to making it better.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *