Test & Code in Python

PyBites Code Challenges

PyBites Code Challenges

Here are the links:

And here's my story.

In episode 64, I describe how to get better at your technical and people skills through effortful study and practice.

PyBites Code Challenges is the sponsor of that episode. That's not a coincidence.

I was preparing for my interview with Julan for episode 60, "100 Days of Code with Julian Sequeira, and I signed up for PyBites Code Challenges to try it out to help me ask Julian questions.

PyBites Code Challenges

The interactive challenges are under a left hand sidebar link called "Python Exercises", but you can get to them through your "Dashboard" as well.

There are 10 intro challenges to let you try out the platform.

When doing a challenge, there's a description of the problem, and somethings a few hints. Then there's a partial solution. Usually a function or more that has a pass statement that you have to replace with real code.

Then there's a tests tab. That has the test code that's going to be used to test your code.

When you think you've maybe got part of the solution, you can hit "Save and Run Tests". The tests are pytest based. And the output is available to show you if you still need to work on the solution.

One Challenge

I did a few of these challenges. And something clicked in my mind.

When I'm coding at work, I'm not always practicing iterative development. I'm sometimes just making it work, and moving on to the next thing.

But here in this little micro-world of code challenges, I can iterate.

I start with just making it work.
When I finally get the tests to pass, I look at my code.
Is it maintainable? Would I be proud of it in a code review?
Is it ready for someone else to take over?
If not, I use this environment to practice that skill and refactor the code.
And recheck to make sure the code still works.

And then sometimes I take it further.
Can I make the code smaller? Can I make it one line, even if it's completely unreadable at that point? Kinda fun to try sometimes.

Fun. Yes, fun.

Code at work is sometimes not. But this is.
And I'm learning bits and corners of Python I didn't know was there.

I also like to compare my answer with the "one possible solution" that they provide. I usually learn something. Recently I learned about how to use re.split().

This is fun coding. And it's freedom. If I don't get it right, it doesn't hurt anyone. And I don't have to get it done quickly. But I'm also focused and learning. Why? I wanted to know more into the mechanics of how this was working. Not the technical details. The behavior details of practice. So I started researching for this episode.

Thanks Bob and Julian for this great service, and for helping to bring a bit of extra fun into my professional life.

To try this out yourself, please use this link: PyBites Code Challenges. It let's them know I sent you, and if you end up signing up for a paid plan, I get a small percentage.

So use that link first, and then when you find out you love it and are ready to sign up for a paid plan, use this link: 20% discount link for PyBites Code Challenges premium tier.