No matter what i do, it’s still showing ‘You should print Unexpected format ‘: ’ at position . (where , , and should be replaced by the current key, value and index) inside your for loop.’
Your code so far
invalid_records = find_invalid_records(**dictionary)
# User Editable Region
for key, val in invalid_records:
print(f"Unexpected format '{key}: {val}' at position {index}.")
is_invalid = True
if is_invalid:
return False
# User Editable Region
print('Valid format.')
return True
validate(medical_records)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Do key and val both exist inside invalid_records? Find out by changing keys or values inside medical_records to be invalid. Then log invalid_records. What does it contain? What type of data structure is it?