So I'm setting out on my coding journey by completing hackerrank problems, and I'm stuck in a step. I will not explain the problem, but will only try to explain the step I'm stuck in.
So I have a list of strings, all of them except for the last one have the "\r" escape sequence, as a string.
I try to remove the \r manually using re but fail to do so. Please help me out!
(Edit: I actually used re.sub, I just typed it wrong)
Here is the code:
`l = ['S;V;iPad\r', 'C;M;mouse pad\r', 'C;C;code swarm\r', 'S;C;OrangeHighlighter']
pattern= re.compile("""\\[r]""")
l_new = [pattern.sub(i,'') for i in l] `