input: Write a function to parse a given URL and extract and print the protocol, domain name, and path using Python. The function should take a single argument, which is the URL as a string. Use the `urllib.parse.urlparse` method to parse the URL and extract the required components.
  assert parse_url('https://www.example.com/path/to/file')==('https', 'www.example.com', '/path/to/file')
  assert parse_url('http://test.com/home')==('http', 'test.com', '/home')
  assert parse_url('ftp://ftp.domain.com/upload')==('ftp', 'ftp.domain.com', '/upload')
  assert parse_url('https://sub.host.com/root/folder')==('https', 'sub.host.com', '/root/folder')
  assert parse_url('http://localhost:8080/index')==('http', 'localhost:8080', '/index')
output: def parse_url(url):
      from urllib.parse import urlparse
      parsed = urlparse(url)
      return parsed.scheme, parsed.netloc, parsed.path