June 2002
Beginner to intermediate
640 pages
14h 24m
English
The capitalize(word) function capitalizes a given word in a string.
>>> capitalize("bill")
'Bill'
The capwords(s) function capitalizes all words in a string.
>>> str = "bill joy" >>> str = capwords(str) >>> print str Bill Joy
The swapcases(s) function converts uppercase letters to lowercase letters and vice versa.
>>> swapcase("ABC abc 123")
'abc ABC 123'
(Frankly, I don't see the value of this one.)
The lower(s) function converts uppercase letters to lowercase letters.
>>> lower("ABC abc 123")
'abc abc 123'
The upper(s) function converts lowercase letters to uppercase letters.
>>> upper("ABC abc 123")
'ABC ABC 123'
Read now
Unlock full access