The best way to outwit online fraudsters is to block them immediately. But there more funny ways to make it clear that you are not served by someone's demand for money. Frank Flemming Jensen from Denmark was approached by a woman on Facebook who told him she needed money for a "plane ticket" to come and see him. He has found the perfect way of answering back.

Fleming Jensen was clearly suspicious of her intentions and instead of ignoring her pleas, he string her along with dozens of soppy messages taken from Adele's 2015 hit single "Hello". The person on the other side of the conversation is initially confused, then she appears to become increasingly frustrated, and begins to wonder if he's mistaken her for another woman. As he continues bombarding her with Adele lyrics, she begins to lose patience. Until she (or he because the person may be using a false identity) eventually realizes she is being strung along, and blasts "I smash your life". Fleming Jensen captured this hilarious moment and published the dialogue on his Facebook page1.

Frank told the Danish newspaper MetroXpress2:

It all happened very spontaneously. I had just heard the song "Hello" on the radio, when someone contacted me online. It was mega-satisfactory. I howled with laughter from behind the screen, and marveled tremendously over the person who had desperately tried to lure money from me. It gave me such a good feeling that I could deceive that person myself.

Below you can read the entire conversion with Adele lyrics in blue:

Adele 01
Fragment 01 van de online conversatie van Frank Fleming Jensen.
Adele 02
Fragment 02 van de online conversatie van Frank Fleming Jensen.
Adele 03
Fragment 03 van de online conversatie van Frank Fleming Jensen.
Adele 04
Fragment 04 van de online conversatie van Frank Fleming Jensen.
Adele 05
Fragment 05 van de online conversatie van Frank Fleming Jensen.
Adele 06
Fragment 06 van de online conversatie van Frank Fleming Jensen.
Adele 07
Fragment 07 van de online conversatie van Frank Fleming Jensen.
Adele 08
Fragment 08 van de online conversatie van Frank Fleming Jensen.
Adele 09
Fragment 09 van de online conversatie van Frank Fleming Jensen.
Adele 10
Fragment 10 van de online conversatie van Frank Fleming Jensen.
Adele 11
Fragment 11 van de online conversatie van Frank Fleming Jensen.

Assignment

Write a function mix that takes two locations of text files as its arguments. The function may assume that both text files exist. The function must repetitively read the next line from each of these files, and output them one after the other: first the line that was read from the file passed as the first argument, and then the line that was read from the file passed as the second argument. This procedure stops as soon as all lines of at least one of the files have been processed. All lines from the second file must be enclosed between --> and <--. For example, if we consider this 12 line text fragment from the song "Martha" of Tom Waits:

Operator, number, please
It's been so many years
Will she remember my old voice
While I fight the tears?
Hello, hello there, is this Martha?
This is old Tom Frost
And I am calling long distance
Don't worry 'bout the cost
'Cause it's been forty years or more
Now Martha please recall
Meet me out for coffee
Where we'll talk about it all

and mix it with this 4 line text fragment from the song "Hello" of Adele:

Hello from the other side
I must have called a thousand times
To tell you I'm sorry for everything that I've done
But when I call you never seem to be home

then we get the following 8 lines as a result:

Operator, number, please
-->Hello from the other side<--
It's been so many years
-->I must have called a thousand times<--
Will she remember my old voice
-->To tell you I'm sorry for everything that I've done<--
While I fight the tears?
-->But when I call you never seem to be home<--

Note that the output does not contain all lines from the file containing the text fragment of Tom Waits, as this file has more lines than the file containing the text fragment of Adele.

The function mix also has an optional third parameter that may take the location of a text file. If a third argument is passed, the function should not output the result to the screen, but write it to a text file at the given location. In case a file already existed at the given location, the content of that file should be overwritten. Otherwise, a new file must be created at the given location.

Example

In the following interactive session, we assume that the text files tom_waits.txt3 and adele.txt4 are located in the current directory.

>>> mix('tom_waits.txt', 'adele.txt')
Operator, number, please
-->Hello from the other side<--
It's been so many years
-->I must have called a thousand times<--
Will she remember my old voice
-->To tell you I'm sorry for everything that I've done<--
While I fight the tears?
-->But when I call you never seem to be home<--

>>> mix('tom_waits.txt', 'adele.txt', 'mix.txt')
>>> print(open('mix.txt', 'r').read(), end='')
Operator, number, please
-->Hello from the other side<--
It's been so many years
-->I must have called a thousand times<--
Will she remember my old voice
-->To tell you I'm sorry for everything that I've done<--
While I fight the tears?
-->But when I call you never seem to be home<--