input: Write a function to parse a JSON data structure. Given a JSON string, the function should return the name, age, and occupation as a tuple. If the JSON data is invalid, the function should return None.
  assert parse_json('{"name": "Alice", "age": 25, "occupation": "Teacher"}')==('Alice', 25, 'Teacher')
  assert parse_json('{"name": "Bob", "age": 30, "occupation": "Doctor"}')==('Bob', 30, 'Doctor')
  assert parse_json('{"name": "Charlie", "age": 40, "occupation": "Engineer"}')==('Charlie', 40, 'Engineer')
  assert parse_json('{"invalid": "JSON"}')==None
  assert parse_json('invalid JSON string')==None
output: def parse_json(json_str):
      try:
          data = json.loads(json_str)
          if 'name' in data and 'age' in data and 'occupation' in data:
              return (data['name'], data['age'], data['occupation'])
          else:
              return None
      except json.JSONDecodeError:
          return None