Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) [45 Points] Haiku Generator Haiku is a Japanese poetic form. In the following table you will find a few examples of this poetic

1) [45 Points] Haiku Generator Haiku is a Japanese poetic form. In the following table you will find a fewHere's an example of how to create a list in python. This list contains four one syllabus adjectives:

1) [45 Points] Haiku Generator Haiku is a Japanese poetic form. In the following table you will find a few examples of this poetic form. This is a Haiku This has seven syllables Followed by just five An old silent pond... A frog jumps into the pond, splash! Silence again Political ads Require suspended thought and thoughtless suspense. Things to note about the poetic form: It has only three lines, totaling 17 syllables throughout. The first line must be only 5 syllables. The second line must be comprised of 7 syllables. The third line must be 5 syllables like the first line. Punctuation and capitalization rules are up to the poet and need not follow rigid rules used in structuring sentences. Haiku does not have to rhyme and usually doesn't. Some haiku can include the repetition of words or sounds. TIP: Devise some pattern (Line1 = "The" + one syllable adjective + one syllable noun + etc...) and use it for all the poems that your program will generate. sugar castle melts moat of cream, black coffee rain pie completes my dream List 1: One syllable nouns List 2: Two syllable nouns List 3: One syllable adjectives List 4: Two syllable adjectives List 5: Two syllable verbs Create a Python program called haiku_generator.py that generates a Haiku. Import the random module at the beginning of your program. Then, create five lists where each list contains at least ten words of your choosing. The five lists should contain the following: Here's an example of how to create a list in python. This list contains four one syllabus adjectives: one_syl_adj = ['tall', 'wise', 'strange', 'great'] Use the random module to select words randomly from each of your lists and construct a Haiku. Make sure you have five syllables on the first and third lines, and seven syllables on the second line. The Haiku will be represented as a string in your program that you will print at the end of the program. You will use string concatenation to build the string in following pattern: The the To select random words from the list, you can utilize the following code as an example. The code generates a random index and uses it to access the one_syl_adj list. a_random_one_syl_adj = Here's an example of building the first part of the Haiku. Refer to full pattern shown on the previous page to continue building the Haiku string in your code. one_syl_adj [random.randint (0, 3)] haiku = ' The ' + a_random_one_syl_adj + ' ' Finally display the Haiku. A sample output is shown below. Sample output Your Haiku is: The great flakey cat study the perfect tasty happy happy purple

Step by Step Solution

3.47 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

Certainly To create a Python program that generates a random Haiku according to the guidelines provi... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Accounting and Reporting a Global Perspective

Authors: Michel Lebas, Herve Stolowy, Yuan Ding

4th edition

978-1408066621, 1408066629, 1408076861, 978-1408076866

More Books

Students also viewed these Programming questions