input: Write a function to find and return the longest string in a given list of strings. If the input list is empty, return None.
  assert longest_string(['foo', 'test', 'longstring', 'bar'])=='longstring'
  assert longest_string(['short', 'verylongstring', 'medium'])=='verylongstring'
  assert longest_string([])==None
  assert longest_string(['one', 'two', 'three'])=='three'
  assert longest_string(['', 'empty', 'not'])=='empty'
output: def longest_string(strings):
      if not strings:
          return None
      return max(strings, key=len)