Golf Scripting a function to print a scales pattern
The goal is to develop a function scales(n)
that takes a non-negative integer n
and prints a pattern of scales, in the smallest code length possible. With help from Clarence, we got the code down to 94 chars.
A few things I learned from developing this:
- Python doesn't need as many spaces as you might think
- Sometimes, you don't need to escape the escape character
- Learning doesn't always have to come from producing something useful
- Decrease and conquer
This was the sample execution for the problem:
This is the test output of the code developed: