0

Can we define a function iscaptialized() to check if the first letter of the input string is in upper case?

The below code is not so elegant as I would have to repeat the ifelse for all the 26 alphabets. Is there an alternate/elegant way to define?

    def iscapitalized():
        if word.startswith('A'):
           print('True')
       else:
           print('False')

    word = input('Enter a word:')
    iscapitalized()

0 Answers0