variable.upper()
variable.lower()
The above function work on the string data type, using Dot Notation.
For example:
>> song="old mcdonald had a farm"
>> print song.upper()
OLD MCDONALD HAD A FARM
However, the function of len() and str() can be used on different types of data, not only string, no Dot Notation. For example:
>>song="old mcdonald had farm"
>>print len(song)
23
No comments:
Post a Comment