Advertisement
# Signature of istitle() method
istitle()
# Python - Method istitle() Example
# Creating a string
s1 = ('I Love Minions')
# Printing the original string
print('Value of string : ', s1)
# Calling the upper() method on string object
print('Calling the istitle() method on string : ', s1.istitle())
Value of string : I Love Minions
Calling the upper() method on string : True
Advertisement
# Python - Method istitle() Example
# Calling istitle() method on a string of all upper case characters
print('NEVER GIVE UP'.istitle())
# Calling istitle() method on a string of only digits
print('123'.istitle())
# Calling istitle() method on a string of digits and upper case characters
print('123.. Go!'.istitle())
# Calling istitle() method on a string of all upper case characters except one lowercase letter
print('Shine Like a Star!'.istitle())
# Calling istitle() method on a string with mix of non-alphabets and alphabetic characters
print('#1 Sun 2# Mercury 3# Venus 4# Earth #5 Jupiter #6 Saturn #7 Uranus #8 Neptune'.istitle())
False
False
True
False
True
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement