Counting words in a string??

mm0fmf none at invalid.com
Fri Sep 30 16:06:56 EDT 2016


On 30/09/2016 20:12, Jake wrote:
> On Friday, 30 September 2016 19:49:57 UTC+1, srinivas devaki  wrote:
>> On Oct 1, 2016 12:10 AM, "Jake" <jakemorroll18 at gmail.com> wrote:
>>>
>>> Hi, I need a program which:
>>> 1) Asks the user for a sentence of their choice (not including
>> punctuation)
>>> 2) Ask the user which word they would like to know is repeated
>>> 3) Print out to the user how many times the word came up which they chose
>> from their sentence.
>>>
>>
>> typical home work assignment, even though stop asking for programs and
>> start asking how to make the same.
>>
>> anyway if you ever try to write code for this you have to split you
>> sentence and use a dict for counting
>>
>> Python has Counter from collections but it is a little bit slower when
>> compared to defaultdict for this kind of purpose.
>>
>> Regards
>> Srinivas Devaki
>> Senior (final yr) student at Indian Institute of Technology (ISM), Dhanbad
>> Computer Science and Engineering Department
>> ph: +91 9491 383 249
>> telegram_id: @eightnoteight
>
> ----------
> Could you make the program for me or provide an outline?
>
How much will you pay for a commented program or an outline?



More information about the Python-list mailing list