コード例 #1
0
ファイル: 13.py プロジェクト: Arvykins/61a-sp14-website
def acronym_gen(name):
    """Return a tuple of the letters that form the acronym for name.

    >>> acronym_gen('University of California Berkeley')
    ('U', 'C', 'B')
    """
    return tuple(w[0] for w in name.split() if capitalized(w))
コード例 #2
0
ファイル: 13.py プロジェクト: sunnysong1204/61a-sp14-website
def acronym(name):
    """Return a tuple of the letters that form the acronym for name.

    >>> acronym('University of California Berkeley')
    ('U', 'C', 'B')
    """
    return tuple(map(first, filter(capitalized, name.split())))
コード例 #3
0
ファイル: 13.py プロジェクト: Arvykins/61a-sp14-website
def acronym(name):
    """Return a tuple of the letters that form the acronym for name.

    >>> acronym('University of California Berkeley')
    ('U', 'C', 'B')
    """
    return tuple(map(first, filter(capitalized, name.split())))
コード例 #4
0
ファイル: 13.py プロジェクト: sunnysong1204/61a-sp14-website
def acronym_gen(name):
    """Return a tuple of the letters that form the acronym for name.

    >>> acronym_gen('University of California Berkeley')
    ('U', 'C', 'B')
    """
    return tuple(w[0] for w in name.split() if capitalized(w))