Write a Python program that performs two functions on a given string: 1. Counts and outputs the number of time the word
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Write a Python program that performs two functions on a given string: 1. Counts and outputs the number of time the word
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 string 1 = "China is 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."
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!