input: Write a function to find and return the longest string from a list of strings. If the list is empty, return None.
  assert longest_string(['foo', 'test', 'longstring', 'bar'])=='longstring'
  assert longest_string(['short', 'longer', 'longest'])=='longest'
  assert longest_string([])==None
  assert longest_string(['single'])=='single'
  assert longest_string(['abc', 'defgh', 'ijk'])=='defgh'
output: def longest_string(strings):
      if not strings:
          return None
      return max(strings, key=len)