Hello, I'm trying to make a program that asks for the user's initials (3 letters) and a block of text, and then reports how many times their initials showed up in the block of text.

For example, if my intials are VKL, and I type "Victor likes licking people" as a block of text, the program should print out "Your string contained 6 matches from your initials."

My code is below, I'm making some progress so far. Can anyone tell me what I must do next? What loop is the best to use?

initials = []
        initials = input("Please enter your initials.")

        initials.count(initials)

        text = input("Please enter a line of text.")

        print(text)
Member Avatar for diafol

perhaps you'd be better off posting to a specific forum. In which language are you coding?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.