On 8/8/19 12:26 PM, Paolo G. Cantore wrote:
> I think the special case treatment could be avoided.
>
> First: Join all items with ' and '
> Second: Replace all ' and ' with ', ' except the last
That works great, until one of the elements of the original list is
"spam and eggs":
>>> spam = [
Am 08.08.19 um 01:18 schrieb MRAB:
On 2019-08-07 21:36, Kuyateh Yankz wrote:
#trying to write a function that takes a list value as an argument and
returns a string with all the items separated by a comma and a space,
with and inserted before the last item. For example, passing the
previous sp
On 2019-08-07 21:36, Kuyateh Yankz wrote:
#trying to write a function that takes a list value as an argument and returns a string with all the items separated by a comma and a space, with and inserted before the last item. For example, passing the previous spam list to the function would return
#trying to write a function that takes a list value as an argument and returns
a string with all the items separated by a comma and a space, with and inserted
before the last item. For example, passing the previous spam list to the
function would return 'apples, bananas, tofu, and cats'. But y
On 01/-10/-28163 02:59 PM, Cathy James wrote:
I need a jolt here with my python excercise, please somebody!! How can I
make my functions work correctly? I tried below but I get the following
error:
if f_dict[capitalize]:
KeyError:
Code below:
def capitalize (s):
"""capitalize accepts a
On Fri, Jun 3, 2011 at 7:42 AM, Cathy James wrote:
> I need a jolt here with my python excercise, please somebody!! How can I
> make my functions work correctly? I tried below but I get the following
> error:
>
> if f_dict[capitalize]:
>
> KeyError:
>
This error is because the function capitaliz
On 06/03/2011 09:42 AM, Cathy James wrote:
I need a jolt here with my python excercise, please somebody!! How can I
make my functions work correctly? I tried below but I get the following
error:
if f_dict[capitalize]:
KeyError:
def capitalize (s):
Here you define the variable "capitalize" as
On 2011.06.03 09:42 AM, Cathy James wrote:
> I need a jolt here with my python excercise, please somebody!! How can
> I make my functions work correctly? I tried below but I get the
> following error:
>
> if f_dict[capitalize]:
>
> KeyError:
>
...
>
> def capitalize (s):
> """capitalize accep
I need a jolt here with my python excercise, please somebody!! How can I
make my functions work correctly? I tried below but I get the following
error:
if f_dict[capitalize]:
KeyError:
Code below:
def capitalize (s):
"""capitalize accepts a string parameter and applies the capitalize()
m