# "Build a Medical Data Validator" Python project, Step 44

**URL:** <https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223>\
**Category:** General\
**Created:** [March 4, 2026, 8:52pm UTC](https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223 "2026-03-04T20:52:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nik18](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/nik18/32/383487_2.png) [@Nik18](https://forum.freecodecamp.org/u/Nik18)\
**Post date:** [March 4, 2026, 8:52pm UTC](https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223/1 "2026-03-04T20:52:46Z")

</div>

Не розумію в чому проблема. **“Build a Medical Data Validator”** Python project, **Step 44**

```auto
for index, key in enumerate(invalid_records):
            val = dictionary\[key\]
            print(f"Unexpected format '{key}:{val}' at position {index}.")
            is_invalid = True

```

Що не так. Чому не працює код?

---

<div class="post-metadata">

**Author:** ![dhess](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dhess/32/406235_2.png) [@dhess](https://forum.freecodecamp.org/u/dhess)\
**Post date:** [March 4, 2026, 8:58pm UTC](https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223/2 "2026-03-04T20:58:58Z")

</div>

Please post a link to the challenge. Thank you.

* * *

I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add the backticks.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (').

---

<div class="post-metadata">

**Author:** ![dhess](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dhess/32/406235_2.png) [@dhess](https://forum.freecodecamp.org/u/dhess)\
**Post date:** [March 4, 2026, 9:09pm UTC](https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223/3 "2026-03-04T21:09:04Z")

</div>

> `for index, dictionary in enumerate(data):`

You are writing your code inside this loop, so you already have the index available.

Please make sure your f-string matches the text in the instructions, including the spacing.

---

<div class="post-metadata">

**Author:** ![Nik18](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/nik18/32/383487_2.png) [@Nik18](https://forum.freecodecamp.org/u/Nik18)\
**Post date:** [March 4, 2026, 9:25pm UTC](https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223/4 "2026-03-04T21:25:35Z")

</div>

> [@dhess](#):
>
> I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.
> 
> ```for key in invalid\_records:
> 
> val = dictionary[key]
> 
> print(f"Unexpected format’{key}:{val}'at position {index}")
> 
> is\_invalid = TrueYou can also use the “preformatted text” tool in the editor (`</>`) to add the backticks.

> [@dhess](#):
>
> I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.
> 
> You can also use the “preformatted text” tool in the editor (`</>`) to add the backticks.

```for key in invalid\_records:

```
        val = dictionary\[key\]

        print(f"Unexpected format'{key}:{val}'at position {index}")

        is_invalid = True

```

Витрачено пів дня не зрозуміло на що.

---

<div class="post-metadata">

**Author:** ![dhess](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dhess/32/406235_2.png) [@dhess](https://forum.freecodecamp.org/u/dhess)\
**Post date:** [March 4, 2026, 9:31pm UTC](https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223/5 "2026-03-04T21:31:56Z")

</div>

> [@Nik18](#):
>
> `f"Unexpected format'{key}:{val}'at position {index}"`

Does the spacing in your f-string match the text in the instructions?

---

<div class="post-metadata">

**Author:** ![Nik18](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/nik18/32/383487_2.png) [@Nik18](https://forum.freecodecamp.org/u/Nik18)\
**Post date:** [March 4, 2026, 9:49pm UTC](https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223/6 "2026-03-04T21:49:10Z")

</div>

```auto
print(Unexpected format '<key>:<val>' at position <index>.)

```

OK. Code with this string format also doesn’t work

---

<div class="post-metadata">

**Author:** ![dhess](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dhess/32/406235_2.png) [@dhess](https://forum.freecodecamp.org/u/dhess)\
**Post date:** [March 4, 2026, 10:04pm UTC](https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223/7 "2026-03-04T22:04:38Z")

</div>

> [@Nik18](#):
>
> `print(f"Unexpected format'{key}:{val}'at position {index}")`

I don’t see a space after the word ‘format’ or after the colon or after the last single quote.

Again, here’s the string from the instructions. Try copying and pasting it in your code and just replacing the angle brackets with curly braces.

`Unexpected format '<key>: <val>' at position <index>.`

---

<div class="post-metadata">

**Author:** ![Nik18](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/nik18/32/383487_2.png) [@Nik18](https://forum.freecodecamp.org/u/Nik18)\
**Post date:** [March 4, 2026, 10:17pm UTC](https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223/8 "2026-03-04T22:17:52Z")

</div>

Thanks for the tip. Finally I found the problem. There were several of them. Little things that take up a lot of time and discourage further learning.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [April 1, 2026, 10:18pm UTC](https://forum.freecodecamp.org/t/build-a-medical-data-validator-python-project-step-44/781223/9 "2026-04-01T22:18:18Z")

</div>

Closed on April 1, 2026, 10:18pm UTC

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