Generate a Python function that takes in a list of words and returns the length of the longest word.
['Ram', 'Shyam', 'Mohan']
def longest_word_length(words):
   length = 0
   for word in words:
       if len(word) > length:
           length = len(word)
           
   return length