Write a program that finds the number of times the following substrings apper in the text:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that finds the number of times the following substrings apper in the text: "un" "an" "in" "he" File name: substr_finder Sample Output: In the following paragraph: Debating me breeding be answered an he. Spoil event was words her off cause any. Tears woman which no is world miles woody. Wished be do mutual except in effect answer. Had friendship thoroughly cultivated son hills day ten. Examine waiting his evening day passage proceed. "un" appears in the text 0 time(s) and the lowest index of the first occurrence of "un" is at index -1 "an" appears in the text 5 time(s) and the lowest index of the first occurrence of "an" is at index 24 "in" appears in the text 6 time(s) and the lowest index of the first occurrence of "in" is at index 5 "he" appears in the text 3 time(s) and the lowest index of the first occurrence of "he" is at index 36 pass Write a program that finds the number of times the following substrings apper in the text: "un" "an" "in" "he" File name: substr_finder Sample Output: In the following paragraph: Debating me breeding be answered an he. Spoil event was words her off cause any. Tears woman which no is world miles woody. Wished be do mutual except in effect answer. Had friendship thoroughly cultivated son hills day ten. Examine waiting his evening day passage proceed. "un" appears in the text 0 time(s) and the lowest index of the first occurrence of "un" is at index -1 "an" appears in the text 5 time(s) and the lowest index of the first occurrence of "an" is at index 24 "in" appears in the text 6 time(s) and the lowest index of the first occurrence of "in" is at index 5 "he" appears in the text 3 time(s) and the lowest index of the first occurrence of "he" is at index 36 pass
Expert Answer:
Answer rating: 100% (QA)
Python program to find the number of times specific substrings appear in a given text and also find ... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
a. Let M be the Deterministic Finite Automata (DFA) shown below: (15 points) 0 1 0,1 90 q1 0 0 92 93 Please provide a formal description of M . In plain English, describe the language described by...
-
At the end of 2021, Velazquez Inc. has 39,000,000 shares of stock outstanding and the market price of its stock was $35.60 per share. Calculate the days' sales in receivables as of the end of 2021....
-
Life is good, thought Will Stallard as he got into his truck that October morning. He could have been thinking of any one of a number of thingshis wife of seven years, his beautiful baby girl, or his...
-
Tim plays a computer game. Each game is a win or a loss. He wins three fifths of his first 40 games. He then wins his next 12 games. For all 52 games, Required: work out the ratio wins: losses Give...
-
An atom in the state with quantum numbers L = 2, S = 1 is located in a weak magnetic field. Find its magnetic moment if the least possible angle between the angular momentum and the field direction...
-
Jurvin Enterprises is a manufacturing company that had no beginning inventories. A subset of the transactions that it recorded during a recent month is shown below. $ 7 5 , 9 0 0 in raw materials...
-
Von Krmn assumed a cubic profile for the integral momentum analysis over a flat plate. Since a cubic has four constants, four conditions were used. (i) \(V_{x}=0\) at \(y=0\). (ii)...
-
Jordans Furniture is a unique retail chain. In fact, every one of its stores in New England is uniqueand highly profitable. And thats what caught the eye of Warren Buffett, the head of conglomerate...
-
(4%) Problem 15: A patient is receiving saline solution from an intravenous (IV) system. The solution passes through a needle of length 2.2 cm and radius 0.16 mm. There is an 8.00 mm-Hg gauge...
-
Reba Dixon is a fifth-grade school teacher who earned a salary of $38,000 in 2020. She is 45 years old and has been divorced for four years. She receives $1,200 of alimony payments each month from...
-
Your accounting professor has assigned a major assignment for your course which accounts for 25% of your final grade for the semester. You recently spoke with one of your friends at Deloittes LLP an...
-
Chinese exports of pharmaceutical products and health supplements worldwide jumped 3 percent to $56 billion last year. Chinese pharma exports to the U.S. rose 4 percent. Questions are being asked in...
-
An experiment that awarded teachers higher pay if their students test results were higher suggests that the bonuses didnt simply lead teachers to teach to the test, but provided their students with...
-
What are the key measures of the effectiveness of your online presence?
-
In 2016, Toni taught music and earned $20,000. She also earned $4,000 by renting out her basement. On January 1, 2017, she quit teaching, stopped renting out her basement, and began to use it as the...
-
How Much Does an American Wedding Cost? A survey by The Knot reports the national aver age cost of a wedding, excluding the honeymoon, was $35,329 in 2016, up from $32,641 in 2015 and $31,213 in...
-
Marie Monahan is employed as a teacher at Hobart Primary School; she is an Australian tax resident. Marie has been working for the school since she graduated from university. Marie is currently...
-
Suppose you won a financial literacy competition and are given FJS10000 to invest, with the condition that investment can be done either in, i) Invest in Unit trust of Fiji or Invest in Fijian...
-
Write a program that will read sentences from a text file, placing each sentence in its own instance of ArrayList. (You will create a sentence object by adding words to it one at a time as they are...
-
Add a method bubbleSort to the class ArraySorter, as given in Listing 7.10, that performs a bubble sort of an array. The bubble sort algorithm examines all adjacent pairs of elements in the array...
-
Repeat Practice Program 7 using JOptionPane, which is described in the graphics supplements of Chapters 2 and 3. Practice Program 7 Combine the programs from Programming Projects 5 and 6 to read...
-
Describe the significance of the term filious nullius.
-
Calculate the isentropic compressibility for air at a pressure of \(0.5 \mathrm{~atm}\). Compare the result with that for the isothermal compressibility obtained in Example 1.3. Data From Example...
-
Describe the nature and significance of the biology plus approach to establishing parental rights for unwed fathers.
Study smarter with the SolutionInn App