I've been struggling with this assignment for a few days and can't figure out how to write proper pythonic code to replace the values in the lists when there are pipes in the list strings.

* We have 2 variables: `fr` and `d`. `fr` is a list of strings and `d` is a dictionary with email addresses as keys and numbers as values (numbers in string format).
* Write code to replace the email address in each of the strings in the `fr` list with the associated value of that email looked up from the dictionary `d`.
	+ If the dictionary does not contain the email found in the list, add a new entry in the dictionary for the email found in the `fr` list. The value for this new email key will be the next highest value number in the dictionary in string format.
* Once the dictionary is populated with this new email key and a new number value, replace that email's occurrence in the `fr` list with the number value.
* Don't manually change `fr` and `d`.

Sample input:

```
fr = [
'7@comp1.COM|4|11|GDSPV',
'7@comp1.COM|16|82|GDSPV',
'13@comp1.COM|12|82|GDSPV',
'26@comp1.COM|19|82|GDSPV'
]

d = {
'7@comp1.COM': '199',
'8@comp4.COM': '200',
'13@comp1.COM': '205'
}

```

The assignment gives what the output should look like, but I'm struggling to get there because of the pipes:

```
Value of fr:
['199|4|11|GDSPV', '199|16|82|GDSPV', '205|12|82|GDSPV', '206|19|82|GDSPV']
Value of d:
{'7@comp1.COM': '199', '8@comp4.COM': '200', '13@comp1.COM': '205', '26@comp1.COM': '206'}

```

This is what the assignment gives you to start off:

```
line_list = []
for line in fr:

```

And this is what I have so far:

```
line_list = []
for line in fr:
    pipes = line.split('|')
    if pipes[0] == '7@comp1.COM':
        pipes[0] = d['7@comp1.COM']

    elif pipes[0] == '13@comp1.COM':
        pipes[0] = d['13@comp1.COM']

    elif pipes[0] == '26@comp1.COM':
        pipes[0] = d['26@comp1.COM']
    print(pipes)

    if len(d) < 4:
        d['26@comp1.COM'] = '206'

print("Value of fr: ")
print(fr)
print("Value of d:")
print(d)

```

Which outputs:

```
['199', '4', '11', 'GDSPV']
['199', '16', '82', 'GDSPV']
['205', '12', '82', 'GDSPV']
['206', '19', '82', 'GDSPV']
Value of fr: 
['7@comp1.COM|4|11|GDSPV', '7@comp1.COM|16|82|GDSPV', '13@comp1.COM|12|82|GDSPV', '26@comp1.COM|19|82|GDSPV']
Value of d:
{'7@comp1.COM': '199', '8@comp4.COM': '200', '13@comp1.COM': '205', '26@comp1.COM': '206'}

```