Think Like a Programmer (Python)

I am currently working (reading) through the excellent “Think Like a Programmer” (V. Anton Spraul) from No Starch Press. The book is written with C++ in mind, but I will instead be trying to solve the puzzles using Python. The book contains C++ solutions, but I want to a) figure out the solution in Python and b) figure it out before reading the C++ solution.

I will not be posting a new blog post each time I solve something, instead I will update this one. I also will only be posting the puzzle titles, not the puzzle information; if you want the puzzle information then please pick up the book.


Chapter Two: Half a Square

i = 4
while (i >=0):
string = ‘#’
print_me = (string*(int(i/len(string))+1))
print(print_me)
i=i-1
———————————–

 

 

Welcome to GeekTechStuff

my home away from home and where I will be sharing my adventures in the world of technology and all things geek.

The technology subjects have varied over the years from Python code to handle ciphers and Pig Latin, to IoT sensors in Azure and Python handling Bluetooth, to Ansible and Terraform and material around DevOps.

Let’s connect