Build a Medical Data Validator - Step 8

Tell us what’s happening:

I thought this step was easy, but I really do not get what the issue is. In the console, I get the message that an indented block is expected after ‘for’ statement. Well, there is an indented block. Help!!

Your code so far

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


# User Editable Region

    for index, dictionary in enumerate(data):
        

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3.1 Safari/605.1.15

Challenge Information:

Build a Medical Data Validator - Step 8

the last line in the instructions:

For now use pass to fill the loop body.

because without you get the error

you don’t have an indented block after the for, at this time there is nothing after the for so you get this error

I managed to solve it thanks.

If someone’s response leads you to solve the problem can you please mark that comment as “solution”? This way it’s obvious this thread is solved and indicates what lead to the solution for future campers who come across the thread.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.