input: Write a function to find and return the longest string from a list of strings. If the list is empty, return an empty string.
  
  def longest_string(str_list): 
      if not str_list: 
          return ''
      longest_str = str_list[0] 
      for str in str_list[1:]: 
          if len(str) > len(longest_str): 
              longest_str = str 
    
      return longest_str 
  
  assert longest_string(['foo', 'test', 'longstring', 'bar'])=='longstring'
  assert longest_string([])==''
  assert longest_string(['a', 'ab', 'abc'])=='abc'
  assert longest_string(['apple', 'banana', 'cherry'])=='banana'
output: def longest_string(str_list): 
      if not str_list: 
          return ''
      longest_str = str_list[0] 
      for str in str_list[1:]: 
          if len(str) > len(longest_str): 
              longest_str = str 
    
      return longest_str