Checking a String in Python
istitleisupperislowerisalphaisalnumisdigitisnumericisspaceGiven a string:
pythontxt = 'Abcde'
Make sure it starts with a capital letter.
Given a list:
pythonlst = ['User1', 'User2', 'user3', 'User4']
Check if each of its elements starts with a capital letter.
Given a string:
pythontxt = 'ABCDE'
Make sure all of its letters are uppercase.
Given a string:
pythontxt = 'abcde'
Make sure all of its letters are lowercase.
Given a string:
pythontxt = 'abcde'
Check that it consists only of letters.
Given a string:
pythontxt = '12345'
Check that it consists only of numbers.
Given a string:
pythontxt = 'Ⅷ'
Check that it consists only of numbers.
Given a string:
pythontxt = '12345abc'
Make sure it only contains letters and numbers.
Given a string:
pythontxt = 'a1b2c3d '
Make sure it only contains letters and numbers.
Given a string:
pythontxt = ' '
Check if it consists only of spaces.
Given a list:
pythonlst = ['a', 'b', ' ', 'c', '']
Check if it contains elements that contain only spaces.