String functions in python

Converting Strings

FunctionDescription
upper()converts all characters to uppercase
lower()converts all characters to lowercase
capitalize()capitalizes first letter as a capital
strip()removes white space
swapcase()reverts small to capital,capital to small

Examples

“codeskulls”.upper()

OUTPUT

‘CODESKULLS‘
“JUNGLE beats”.lower()

OUTPUT

‘jungle beats’
“beats”.capitalize()

OUTPUT

‘Beats’
“ZENt boom”.swapcase( )

OUTPUT

‘zenT BOOM’
Last updated on by vishal devxo