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