[Tutor] Just Joined!

Alex Smith alexsmith24871 at yahoo.com
Thu May 12 13:34:52 CEST 2011


Hi All,

I just joined this list and am really new to python. I have an assignment to create a function with (a_string, width) which returns the a_string with all the lower case characters changed to upper case characters and vice versa and centered; was wondering if someone could point me in the right direction. I am not just asking for the answer but just need a few tips to get started. So far I do know I should use the dir(str)
and do not quite understand what the "width" option is used for....


>>> help(dir)
Help on built-in function dir in module __builtin__:

dir(...)
    dir([object]) -> list of strings
    
    Return an alphabetized list of names comprising (some of) the attributes
    of the given object, and of attributes reachable from it:
    
    No argument:  the names in the current scope.
    Module object:  the module attributes.
    Type or class object:  its attributes, and recursively the attributes of
        its bases.
    Otherwise:  its attributes, its class's attributes, and recursively the
        attributes of its class's base classes.


def SwapcaseAndCenter(dir,??)



Thanks for any advice!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110512/4231bab4/attachment.html>


More information about the Tutor mailing list