---
id: 6849a0d59a98011bb2e46d12
title: Step 11
challengeType: 20
dashedName: step-11
---

# --description--

After the `if` statement, print the string `Valid format.`. Then return `True`.

# --hints--

You should print `Valid format.` after your `if` statement.

```js
({ test: () => assert(runPython(`
_if_statement = "if is_invalid:\\n  return False"
_Node(_code).find_function("validate").is_ordered(_if_statement, "print('Valid format.')")
`)) })
```

You should return `True` after your `print()` call.

```js
({ test: () => assert(runPython(`
_Node(_code).find_function("validate").is_ordered("print('Valid format.')", "return True")
`)) })
```

# --seed--

## --seed-contents--

```py
medical_records = [
    {
        'patient_id': 'P1001',
        'age': 34,
        'gender': 'Female',
        'diagnosis': 'Hypertension',
        'medications': ['Lisinopril'],
        'last_visit_id': 'V2301',
    },
    {
        'patient_id': 'p1002',
        'age': 47,
        'gender': 'male',
        'diagnosis': 'Type 2 Diabetes',
        'medications': ['Metformin', 'Insulin'],
        'last_visit_id': 'v2302',
    },
    {
        'patient_id': 'P1003',
        'age': 29,
        'gender': 'female',
        'diagnosis': 'Asthma',
        'medications': ['Albuterol'],
        'last_visit_id': 'v2303',
    },
    {
        'patient_id': 'p1004',
        'age': 56,
        'gender': 'Male',
        'diagnosis': 'Chronic Back Pain',
        'medications': ['Ibuprofen', 'Physical Therapy'],
        'last_visit_id': 'V2304',
    }
]

def validate(data):
    is_sequence = isinstance(data, (list, tuple))

    if not is_sequence:
        print('Invalid format: expected a list or tuple.')
        return False
        
    is_invalid = False
    
    for index, dictionary in enumerate(data):
        if not isinstance(dictionary, dict):
            print(f'Invalid format: expected a dictionary at position {index}.')
            is_invalid = True

--fcc-editable-region--
    if is_invalid:
        return False
    
--fcc-editable-region--
```
