input: Write a function to find and print the longest string in a list of strings. The function should iterate through each string in the list, compare its length with the current longest string, and update the longest string if a longer one is found. The function should be named `longest_string` and will take a list of strings as its argument.
  
  assert longest_string(['foo', 'test', 'longstring', 'bar'])=='longstring'
  assert longest_string(['short', 'medium', 'longest', 'longer'])=='longest'
  assert longest_string(['apple', 'banana', 'orange'])=='banana'
  assert longest_string(['a', 'bb', 'ccc'])=='ccc'
  assert longest_string([''])==''
output: def longest_string(strings):
      longest = ""
      for s in strings:
          if len(s) > len(longest):
              longest = s
      return longest