newby qn about functions

rantingrick rantingrick at gmail.com
Wed Jan 19 00:49:16 EST 2011


On Jan 18, 12:01 pm, "Joe Goldthwaite" <j... at goldthwaites.com> wrote:
> I'm not sure I understand the question completely but maybe the function
> below does what you want.
>
> def lower_case(s):
>
>     return “Testing Functions-lower case: ” + s.lower()
>
> print lower_case(‘AbCdEfG’)
>
> ________________________________________
> From: python-list-bounces+joe=goldthwaites.... at python.org
> [mailto:python-list-bounces+joe=goldthwaites.... at python.org] On Behalf Of
> Cathy James
> Sent: Tuesday, January 18, 2011 3:02 AM
> To: python-l... at python.org
> Subject: newby qn about functions
>
> #This has to be very simple, but I don't get it-please help
>  
> def
> lower_case(s):
>     #return s
>     print(s)
>     #return s.lower()
>     print(s.lower())
> s=
> "Testing Functions-lower case: "
> lower_case(s)
> """how can i use a return statement  to write a function that returns the
> string "Testing Functions-lower case: "and the lowercase representation of
> its string parameter""" If I uncomment the above, nothing outputs to
> console:(
>  
> Much appreciation as always.

Please don't top post as it gets very confusing to follow especially
when you did not follow proper quoting standards by using the
preferred quote prefix of ">". Have a look at this wiki article for
more information...

    http://en.wikipedia.org/wiki/Posting_style

Thanks



More information about the Python-list mailing list