helpfulness Re: Index of entity in List with a Condition

Cameron Simpson cs at cskk.id.au
Tue Jun 12 20:44:58 EDT 2018


On 11Jun2018 18:03, Rick Johnson <rantingrickjohnson at gmail.com> wrote:
>subhaba... at gmail.com wrote:
>> I have the following sentence,
>>
>> "Donald Trump is the president of United States of America".
[...]
>
>Typically when you ask us to do your homework for you, it is
>considered bad taste to present the teacher's assignment
>verbatim and then expect that we will provide a turn-key
>solution. And although you _did_ provide some sort of
>"Pythony looking" code, unfortunately the code is poorly
>formatted.

Rick, this is unhelpful.

Firstly, Subhabrata isn't getting us to do his work for him; he's posted here 
several times in the past and clearly is working on probems in good faith with 
demonstrated willingness _and_ ability to think things through in detail. He 
comes here having tried things, with specific questions following from problems 
he has encountered.

Secondly, his question is reasonably expressed. Lacking a lot of code, it is 
perfectly feasible and reasonable to respond in general prose form instead of 
purely code.

Finally, adding in political editorial in your code response doesn't improve 
the discussion environment.

If you want to encourage more detail from him, just ask without overtones.

If you're unwilling to engage with his post for whatever criteria, just don't 
engage. Easy!

It is better for all concerned, both the OP and we the list readers.

Thanks,
Cameron Simpson <cs at cskk.id.au>

>Next time, please try to present your question in a formal,
>well-though-out manner. Source code should either be
>executable, or conspicuously labeled as psuedo code. Not
>because we don't _know_ what pseudo code looks like, but
>because we can intuit your level of knowledge from the
>presentation. And i gotta tell ya, this presentation is not
>exactly screaming valedictorian -- but i digress.
>
>Now, as to your problem...
>
>Well, first, hold on a second, because, i want to correct your
>sentence. You presented your target string as:
>
>    "Donald Trump is the president of United States of America"
>
>No-no-no. This sentence seems to be missing a few things.
>The first is a three letter word. And let's insert that word
>now...
>
>    >>> s = "Donald Trump is the president of United States of America"
>    >>> s.index('U')
>    33
>    >>> s = s[:33] + 'the ' + s[33:]
>    >>> s
>    'Donald Trump is the president of the United States of America'
>
>Ah yes. You see how much more smoothly that rolls off the
>ol' tongue? Now, in the interest of public awareness, let's
>add an addendum, shall we?
>
>    >>> s += ", who was duly elected to office by the great people of this fine country in a free and open election. And no amount of whining; pouting; sniveling; conspiratorial hoopla; flailing of the arms; the legs; or any combination thereof for that matter; will change the reality that Donald *BIG JOHN* Trump is now the president of this fine country. Seriously folks. It's been an interesting ride. But the circus is over now. Elvis left the building over a _year_ ago. Heck, Jimmy Hoffa has already rolled over in his grave *THREE* times! But most disturbing of all, is that the dozens of emaciated cats trapped in each of your apartments are on the verge of cannibalism (yesh, you forgot about them, didn't you?), and the toxic ammonia fumes are melting the paint off the walls! It's time to go home and lick your wounds folks. Better luck next time. Aloha."
>
>Whew! (*wipes brow*) Now that we've gotten all of that out of
>the way... what was your question again? o_O
>-- https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list