- Converts the first character of a string to uppercase and the remaining characters to lowercase.
- Takes no parameters and returns a new string with the capitalized first character.
print('aBcD'.capitalize())
OUTPUT:
print('aBcD'.capitalize())
print('['+'Hello, world!'.center(20)+']')
print('Hello, world!'.center(20,'*'))
print('Hello, world!'.endswith('!'))
print('Hello, world!'.find('world'))
print('ab123cd'.isalnum())
print('abcde'.isalpha())
print('123456'.isdigit())
print('hello'.islower())
print(' '.isspace())
print('HELLO'.isupper())
print(','.join(['a', 'b', 'c']))
print(' hello'.lstrip())
print('Hello, world!'.replace('world', 'universe'))
print('Hello, world!'.rfind('o'))
print('hello '.rstrip())
print('a,b,c'.split(','))
print('Hello, world!'.startswith('Hello'))
print(' hello '.strip())
print('hello'.swapcase())
print('hello world'.title())
print('hello'.upper())