Build a Medical Data Validator - Step 44

Hello,

I stuck at Step 44 from Medical Data Validator. It is probably some formatting error, because if I change the data, the validation works, and the output looks also good (at least for me)

For example deleted the “V” from the first ‘last_visit_id’
Console Output: Unexpected format ‘last_visit_id: 2301’ at position 0

part of the code:
for key in invalid_records:
print(f"Unexpected format ‘{key}: {dictionary[key]}’ at position {index}")

Thanks you

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

The problem was the missing period at the end of “print”

You need to iterate through the key elements of the elements that return invalid values.
Since you already have the index from the chained iteration, you only need the value, or val in this case.
For val, we need to access the dictionary[kay] using square bracket notation.
I hope this helps; I was also stuck on this step for a while.

code removed by moderator

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

This sounds more like a formatting issue than a validation issue. I’ve seen cases where the output looked correct visually, but the tests were expecting a slightly different format. Double-check spaces, punctuation, and the exact structure of the printed message.