input: Write a function to group the strings of a given list according to their lengths in Python.
  assert group_strings_by_length(["apple", "mango", "banana", "kiwi", "grapes", "watermelon"]) == {5: ['apple', 'mango', 'kiwi'], 6: ['banana', 'grapes'], 12: ['watermelon']}
  assert group_strings_by_length(["a", "ab", "abc", "abcd"]) == {1: ['a'], 2: ['ab'], 3: ['abc'], 4: ['abcd']}
  assert group_strings_by_length(["dog", "cat", "fish", "elephant"]) == {3: ['dog', 'cat'], 4: ['fish'], 8: ['elephant']}
output: def group_strings_by_length(strings):
      result = {}
      for s in strings:
          length = s.length(s)
          if length not in result:
              result[length] = []
          result[length].append(s)
      return result