Python Poem

Well, this is my second day of learning to code in Python. I decided to write a little love poem, in code…

Bear with me – if the code were accidentally to work, rather than just looking like itself, you could end up with two identical copies of the same silly poem, and no code. Here’s the code:

print(“Ssssending \nlove ‘n \nkisses \nfrom Mr P \nto Mrs”)

And here’s what it’s supposed to print out like:

Ssssending
love ‘n
kisses
from Mr P
to Mrs

Maybe I’ve invented a new art form?

For a moment or two I was quite pleased with myself. However, nothing new under the sun. Further research revealed this Wikipedia entry:

Code poetry is literature that intermixes notions of classical poetry and computer code. Unlike digital poetry, which prominently uses physical computers, code poems may or may not run through executable binaries. A code poem may be interactive or static, digital or analog. Code poems can be performed by computers or humans through spoken word and written text.

Examples of code poetry include: poems written in a programming language, but human readable as poetry; computer code expressed poetically, that is, playful with sound, terseness, or beauty.

And – I just discovered – you can even write a thing that will generate poems. So, each time you press Run, a new version of the same poem appears…

Sigh!  I’ve got a long way to go.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s