List comprehension for a list of lists
list-comprehension, python
Solution
Do
l = [['?' + i[0]] + i[1:] for i in l] (l is the list you pass in)
Problem
ok, so I have a list of lists ``` list = [['a','b','c'], ['1','2','3'], ['x','y','z']] ``` and I want to edit the first item of each list so it has a symbol before it. A "?" in this example. I figure I can use list comprehension to do this. Something similar to this: ``` list = ['?'+x for x in i[0] for i in list] ``` But that just gives me an error. This list comprehension stuff confuses me, how do I do it?