input: def longest_string(str_list: list) -> str:
      """ Finds and returns the longest string in a given list of strings.
      >>> longest_string(['foo', 'test', 'longstring', 'bar'])
      'longstring'
      """
output:     longest = ""
      for s in str_list:
          if len(s) > len(longest):
              longest = s
      return longest