input: 
  def sort_words_by_length_and_alphabet(my_string: str) -> str:
      """
      Sort words in a given string by their length in decreasing order first, 
      then by alphabetical order if words have the same length.
      >>> sort_words_by_length_and_alphabet("This is the string which is to be sorted")
      'be which to the is this string sorted'
      """
      words = my_string.split(' ') # split string into list of words 
      words_with_length = [(len(word), word) for word in words] 
      words_with_length.sort(key=lambda x: (-x[0], x[1]), reverse=False) 
      sorted_string = " ".join([i[1] for i in words_with_length]) 
      return sorted_string
  
output:     words = my_string.split(' ') # split string into list of words 
      words_with_length = [(len(word), word) for word in words] 
      words_with_length.sort(key=lambda x: (-x[0], x[1]), reverse=False) 
      sorted_string = " ".join([i[1] for i in words_with_length]) 
      return sorted_string