input: Write a function to print the longest string in a list of strings. If the list is empty, print an empty string.
  
  
  def longest_string(str_list):
      if not str_list:
          return ""
      longest_str = str_list[0]
      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([]) == ''
  assert longest_string(['short', 'longstring']) == 'longstring'
  assert longest_string(['a', 'b', 'c']) == 'a'
  assert longest_string(['hello', 'world']) == 'hello'
  
output: def longest_string(str_list):
      if not str_list:
          return ""
      longest_str = str_list[0]
      for str in str_list:
          if len(str) > len(longest_str):
              longest_str = str
      return longest_str