[PriP 1.1] Revision Tour-1 – Practical 1.1

|
Table of Contents

6. Write a program to print an acrostic poem as shown below:-

In the output, you need not print bigger letters for P E A C E, but make sure these letters make a vertical word in the output. (Acrostic poems are literary composition in which certain letters in each line form a word vertically. This acrostic poem for Peace was made using Bible verse, John 16:33)

Solution:

Here’s a Python program to print the acrostic poem:

print("These things I have sPoken unto you,")
print("         that in me yE might have peace.")
print("      The world ye shAll have tribulation:")
print("     but be good for Cheer;")
print("       I have overcomE the world.")
Output
These things I have sPoken unto you,
         that in me yE might have peace.
      The world ye shAll have tribulation:
     but be good for Cheer;
       I have overcomE the world.

In the output, the vertical word “PEACE” is formed by the capitalized letters at the beginning of specific words, not necessarily at the beginning of each line. That’s what the definition of acrostic also refers to.

"Spread the light within, illuminate the hearts around you. Sharing is not just an action, but a sacred journey of connecting souls."~ Anonymous

Leave a Reply

Your email address will not be published. Required fields are marked *