input: Write a function to print the longest string in a given list of strings. If the list is empty, print an empty string.
  def longest_string(str_list):
      if not str_list:
          return ''
      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([])==''
  assert longest_string(['a', 'bb', 'ccc', 'dd'])=='ccc'
  assert longest_string(['short', 'looooong', 'longer'])=='looooong'
  assert longest_string(['same', 'same', 'same'])=='same'
output: def longest_string(str_list):
      if not str_list:
          return ''
      longest_str = ''
      for str in str_list:
          if len(str) > len(longest_str):
              longest_str = str
      return longest_str