For example:
inserts = [a + c + b for a, b in splits for c in alphabet]
It's no different (conceptually, at least) than doing: inserts = []
for a, b in splits:
for c in alphabet:
inserts.append(a + c + b)
Or in Ruby (OK, maybe this isn't perfect Ruby): inserts = splits.reduce([]) do |x, (a, b)|
alphabet.each{|c| x << a + c + b }
x
end
But the list comprehension was so difficult for me to read that it might as well have been a brand new concept. But I found I got quickly over it after rewriting all of his comprehensions as for-loops, and then trying to convert them back into comprehensions. It was a good reminder that sometimes the barrier is just plain muscle/memory reflex (and probably much more so for beginning programmers...)