input: Write a function to find and return the longest string in a list of strings.
  def longest_string(str_list):
      longest_str = ''
      for str in str_list:
          if len(str) > len(longest_str):
              longest_str = str
      
      return longest_str
  
  assert longest_string(['foo', 'test', 'longstring', 'bar'])=='longstring'
  assert longest_string(['apple', 'banana', 'cat', 'dog'])=='banana'
  assert longest_string(['short', 'longer', 'longest'])=='longest'
  assert longest_string([])==''
  assert longest_string(['single'])=='single'
output: def longest_string(str_list):
      longest_str = ''
      for str in str_list:
          if len(str) > len(longest_str):
              longest_str = str
      
      return longest_str