Skip to content
Advertisement

Creating dictionary from strings containing a specific letter

I’m trying to create a dictionary from a text file that contains test results.

The text file looks like this:

JavaScript

My goal is to get all the results that contain a number with the letter C. But I manage to get only the first value

For example this is what I get:

JavaScript

This is my code:

JavaScript

What I want to get is result like this example:

JavaScript

And will continue like this as long as there is a number with C.

What am I doing wrong?

Advertisement

Answer

Maybe this will nudge you in the right direction:

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement