I have this nested list:
l = [['40', '20', '10', '30'], ['20', '20', '20', '20', '20', '30', '20'], ['30', '20', '30', '50', '10', '30', '20', '20', '20'], ['100', '100'], ['100', '100', '100', '100', '100'], ['100', '100', '100', '100']]
Now, what I want to do is convert each element in a list to float. My solution is this:
newList = []
for x in l:
for y in x:
newList.append(float(y))
But can this be done using nested list comprehension, right?