The following algorithm is inspired by a poem by Brian Bilston called “snow poem”. On this poem, each word represents a snowflake gently and randomly falling from the sky. On the last verse of this poem, you can see how the snow is starting to settle on the ground!
The aim of this challenge is to investigate a range of string manipulation techniques using Python including:
Splitting a string into a list, using a special character (e.g. space or “/” character)
String concatenation techniques using the * and + operators
Retrieving the length of a string using the len() function.
Here is the Python code for our Snow Poem algorithm:
Using a similar approach, we created an algorithm to reproduce the poem “Needles” by the same author.
Here is the Python code for the poem “Needles”:
There is no coding task attached to this algorithm. If you like this code, you may want to investigate the following challenges: