input: Write a function to parse a JSON data structure and return the name, age, and occupation from the given input. If the input is valid, the function should return a tuple containing the name, age, and occupation. If the input is not valid, the function should return None.
  import json
  
  def parse_json(data):
   try:
       data = json.loads(data)
       return data['name'], data['age'], data['occupation']
   except (json.JSONDecodeError, KeyError):
       return None
  
  assert parse_json('{"name": "John", "age": 18, "occupation": "Software Engineer"}')==("John", 18, "Software Engineer")
  assert parse_json('{"name": "Jane", "age": 22, "occupation": "Designer"}')==("Jane", 22, "Designer")
  assert parse_json('{"name": "Alex", "age": 30, "position": "Developer"}')==None
  assert parse_json('{"name": "Mary", "age": "25", "occupation": "Analyst"}')==("Mary", "25", "Analyst")
  assert parse_json('invalid json')==None
output: 
  def parse_json(data):
   try:
       data = json.loads(data)
       return data['name'], data['age'], data['occupation']
   except (json.JSONDecodeError, KeyError):
       return None
  