input: Write a function to find and return the longest string in a given list of strings. If there are multiple strings with the same maximum length, return the first one encountered. If the list is empty, return an empty string.
  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(['short', 'medium', 'longer', 'longest'])== 'longest'
  assert longest_string(['a', 'b', 'c'])== 'a'
  assert longest_string([])== ''
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