input: Write a function to write a Python program that takes in a list of strings and prints out the longest string in the list.
  
  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(['foo', 'a', 'bar'])=='foo'
  assert longest_string(['code', 'python', 'java'])=='python'
  assert longest_string(['', 'x', 'xy'])=='xy'
  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