Question: Write a Python program that performs two functions on a given string: 1. Counts and outputs the number of time the word the occurs
Write a Python program that performs two functions on a given string: 1. Counts and outputs the number of time the word "the" occurs in the string; 2. Finds the longest word in the string and outputs it and its length. For instance, the string could be string1 = "China one of the fastest-growing economies in the world. China is looking for more investments around the world. Also, the whole world is looking at China as a great economic power. Most of the Chinese can foresee the heights that China is capable of reaching."
Step by Step Solution
There are 3 Steps involved in it
Heres a Python program that performs the specified functions on the given string def analyzestringin... View full answer
Get step-by-step solutions from verified subject matter experts
