November 2024
Beginner to intermediate
456 pages
11h 5m
English
The hints below might help when you are stuck with one of the exercises in this book. They don’t give away the entire solution, but rather try to help you find it yourself.
You can start with a program that prints out the numbers 1 to 7, which you can derive by making a few modifications to the even number printing example given earlier in the chapter, where the for loop was introduced.
Now consider the equivalence between numbers and strings of hash characters. You can go from 1 to 2 by adding 1 (+= 1). You can go from “#” to “##” by adding a character (+= “#”). Thus, your solution can closely follow the number-printing program.
Going over the numbers is clearly ...
Read now
Unlock full access