Did you put a bunch of print statements all over the place or really, any at all? Did you comment out some lines of code and repeatedly run the sample? Did you make changes of any kind and repeatedly run the sample to understand what was happening?
If you answered Yes to any of the above, then you went about it the hard way. You could have introduced additional errors into the code in a non-trivial case. You could have left debugging/print statements in places they shouldn't be. There are probably other good reasons why you shouldn't do it this way.