I was trying to understand List Comprehensions because I needed to improve performance on my project.
I believe this is how they work but please correct me if I am wrong.
To convert a for loop into a list comprehension the below for loop -
for A in B: if Condition: List.append(A)
would turn into
E = [A for A in B if Condition]
I didn't realize this was a duplicate. If the answers on this post were unsatisfactory, you can see the other post at the top of this one.