Python program to find how many times a word repeated in a given string

Rajnilari2015
Posted by Rajnilari2015 under Python category on | Points: 40 | Views : 1201
from System import *
from System.Collections.Generic import *
from System.Linq import *

class Program(object):
def Main(args):
#Question #4: Find how many times a word repeated in a given string.
lstWords = List[str]("hello", "this", "is", "dotnet", "dotnet", "funda", "is", "is")
().ToList().ForEach()
Console.ReadKey(True)

Main = staticmethod(Main)


/*Result

hello : Word hello has never repeated

this : Word this has never repeated

is : Word is repeated 3 times

dotnet : Word dotnet repeated 2 times

funda : Word funda has never repeated*/

Comments or Responses

Login to post response