Stripping Quotations from a List of Lists I have written a short function as part of my program that strips the quotation marks (&quot;) from a list of lists. An example of the input data is:
[['&quot;foo&quot;', '&quot;Spam&quot;', '123', '&quot;Angry Badger&quot;'],
 ['&quot;dead&quot;', '&quot;Parrot&quot;', '321', '987']]

The target result would be:
[['foo', 'Spam', '123', 'Angry Badger'],
 ['dead', 'Parrot', '321', '987']]

This code I am using to parse this is:
def quote_strip(input_file):

    for k1, v1 in enumerate(input_file):
        for k2, v2 in enumerate(v1):
            input_file[k1][k2] = v2.lstrip('&quot;').rstrip('&quot;')

    return input_file

This works fine, but I am pretty sure there is a way of making this a single line. I just always seem to mess up comprehensions when they have the = sign in them like this.
Any feedback would be greatly appreciated.
I just always seem to mess up comprehensions when they have the = sign in them like this.

I found the best way to think about comprehensions is instead think of comprehensions as .appends.
Lets change your inner loop to use .append instead.
We don't need to use enumerate as we'll be building a new list.
def quote_strip(input_file):
    for k1, v1 in enumerate(input_file):
        inner_list = []
        for v2 in v1:
            inner_list.append(v2.lstrip('&quot;').rstrip('&quot;'))
        input_file[k1] = inner_list
    return input_file

We can now change the code to a comprehension.
I'll show you a pattern which we can just copy:
my_list = []
for item in other_list:
    my_list.append(item + 1)

becomes:
my_list = [
    item + 1
    for item in other_list
]

We just move whatever is in the append(...) to the top of the comprehension.
And move the for loop into the bottom of the list.
def quote_strip(input_file):
    for k1, v1 in enumerate(input_file):
        inner_list = [
            v2.lstrip('&quot;').rstrip('&quot;')
            for v2 in v1
        ]
        input_file[k1] = inner_list
    return input_file

You should notice we can remove the need for assigning to the name inner_list.
def quote_strip(input_file):
    for k1, v1 in enumerate(input_file):
        input_file[k1] = [
            v2.lstrip('&quot;').rstrip('&quot;')
            for v2 in v1
        ]
    return input_file

Now we can change the loop to use .append again.
def quote_strip(input_file):
    output_list = []
    for v1 in input_file:
        output_list.append([
            v2.lstrip('&quot;').rstrip('&quot;')
            for v2 in v1
        ])
    return output_list

And again we can change the code to a list comprehension.
def quote_strip(input_file):
    return [
        [
            v2.lstrip('&quot;').rstrip('&quot;')
            for v2 in v1
        ]
        for v1 in input_file
    ]

Extra

I am pretty sure there is a way of making this a single line

We can put the comprehension on one line but please do not do so.
How many lines of code you write is not important, how easy to read your code is.
Putting the comprehension on one line will make your code harder to read.