1) [45 Points] Haiku Generator Haiku is a Japanese poetic form. In the following table you...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 <one syllable adjective> <two syllable adjective> <one syllable noun> <two syllable verb> the <two syllable noun> <two syllable adjective> <two syllable adjective> <two syllable adjective> <one syllable noun> 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 = '\nThe ' + 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 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 <one syllable adjective> <two syllable adjective> <one syllable noun> <two syllable verb> the <two syllable noun> <two syllable adjective> <two syllable adjective> <two syllable adjective> <one syllable noun> 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 = '\nThe ' + 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
Expert Answer:
Answer rating: 100% (QA)
Certainly To create a Python program that generates a random Haiku according to the guidelines provi... View the full answer
Related Book For
Financial Accounting and Reporting a Global Perspective
ISBN: 978-1408076866
4th edition
Authors: Michel Lebas, Herve Stolowy, Yuan Ding
Posted Date:
Students also viewed these programming questions
-
You are continuing to consult the pizza business owner. The owner is concerned that there may be fradulent behavior of some employees an vendors. In this discussion, make recommendations related to...
-
A technical analysis tool that is sometimes used to predict market movements is an investor sentiment index. AAII, the American Association of Individual Investors, publishes an investor sentiment...
-
Holmes Corporation is a leading designer and manufacturer of material handling and processing equipment for heavy industry in the United States and abroad. Its sales have more than doubled, and its...
-
After assembly, a finished TV is left turned on for one full day (24 h) to determine whether the product is reliable. On average, two TVs break down each day. Yesterday 500 TVs were produced. What is...
-
Charge is uniformly distributed with a density of 100.0 +C/m3 throughout the volume of a cube 10.00 cm on each edge. (a) Find the electric potential at a distance of 5.000 cm from the center of one...
-
What is the heat effect when 150(lbm) of H2SO4 is mixed with 350(lbm) of an aqueous solution containing 25-wt-% H2SO4 in an isothermal process at 100(F)?
-
Moove Motors Ltd produces two models of electronic scooters . The projected financial data for the month of January are as follows. Required Prepare a production budget for January. Small Large...
-
Table shows a data set containing information for 25 of the shadow stocks tracked by the American Association of Individual Investors. Shadow stocks are common stocks of smaller companies that are...
-
Discuss the relationship between sustainability and corporate social responsibility (CSR), addressing how companies can integrate sustainability goals into their business strategies, stakeholder...
-
Maggie's Magazines (MM) has straight nonconvertible bonds that currently yield 9%. MM's stock sells for $22 per share, has an expected constant growth rate of 6%, and has a dividend yield of 4%. MM...
-
What is complex number & conjugate complex number? Prove that the sum and product of two complex number and conjugate complex number is real. 1. 2. Find the modulus and argument of the complex number...
-
ii. Calculate the approximate time delay for the following set of instructions, assuming fosc = 11.059MHZ MOV TMOD, #01H MOV TLO, #0 MOV THO, #0 AGAIN: DELAY: BACK: RET MOV R5, #04 ACALL DELAY CPL...
-
A 75-horsepower outboard motor at full throttle will rotate its propeller at exactly 4900 revolutions per min. Find the angular speed of the propeller in radians per second. 4900 rev per min radians...
-
Consider you have a stack whose elements in it are as follows. 5 4 3 2 < < topWhere the top element is 2.You need to get the following stack 6 5 4 3 2 < < topThe operations that needed to be...
-
Answer the question: Question 2 a. Discuss the four (4) Development Stages of the project team (12 marks) b. Give a detailed explanation for the steps you would take in preparing your first project...
-
Solve for r. 1.32 58.05= r-0.1 Enter your response rounded to 4 DECIMAL PLACES Number
-
Suppose you are a researcher who is studying Pacific White-sided dolphins (Lagenorynchus obliquidens). While studying a captive group of dolphins at an aquarium, you notice a strange tendency for the...
-
Cornell and Roberts are partners who agree to admit Stanley to their partnership. Cornell has a capital balance of $80,000 and Roberts has a capital balance of $120,000. Cornell and Roberts share net...
-
Mr Hans Christian, a senior partner at Harmony Accountancy, has asked an intern to review the issues and the positions the firm should adopt concerning specific rules of revenue recognition adopted...
-
Toyota Motor Corporation (Toyota) primarily conducts business in the automotive industry. Toyota also conducts business in finance and other industries. It is organized in three segments: automotive...
-
In the Exhibits, you will find three main financial statements for two fictitious oil companies. Both firms are involved in exploration, extraction, operation, transportation and refining....
-
Fran frequently attends flea markets looking for good bargains. On a recent trip, she purchased a nightstand for \($25\) and an armoire for \($45.\) When she got them home and took a closer look, she...
-
Tanika passed away in the current year and her daughter, Shanika, received life insurance proceeds of \($500,000.\) Tanika had paid \($12,000\) in premiums on the life insurance policy to date....
-
Todd has received the following payments in the current year: How much must Todd include in his income? Unemployment compensation Food stamps $12,000 $ 1,500 Lottery winnings $ 1,000 Gambling...
Study smarter with the SolutionInn App