I was at the Python Meet the other day, and the person next to me was working with a beginner and mentioned Fizz Buzz. Being my curious self, I googled it:
“Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.”
In an interview context, there’s two points to this question:
1. Can you write original code?
2. Can you write optimized code?
For a beginning programmer, the crux of the matter lies in writing original code (not that optimal code isn’t important – but you want something to show for your work & you want to be able to create cool things at will!). It’s very easy to go from tutorial to tutorial and either copy or imitate others’ examples & go “wow! I’m learning all this cool stuff!!” Except in reality, unless you’re also practicing doing things from Scratch, the tutorials have essentially become a crutch rather than something empowering. You don’t really properly Learn something until you’ve done it so many times that it becomes Second Nature.
I had picked up on the fact that I was doing this a bit before the Python meetup, and so I’ve been trying to make up a template of my own Pygame exercises. As a tangent – It’s important, if you’re a beginner & working on GUI stuff, to also work on Command Line stuff, as it’s the foundation of GUI work & more importantly, if you don’t you’ll have lots of unhelpful Skill Gaps & learn/implement everything less well.
Similarly, It’s really good to do other peoples’ exercises as well – since they don’t come from your brain & will expand your horizon, and often cause you to have to look something up. So you’ll end up learning cool, new useful things.
So, in the Spirit of that, here’s a List of Beginning Coding Exercises that I’ll add to as I come across new ones I like: