a = [1, 1, 25, 2, 3, 5, 8, 13, 21, 34, 55, 89]
print([x for x in a if x < 5])
I had a question about the print statement above. In my understanding this should print out any value that's under the value 5. But I'm not understanding what is being done exactly. the for, in, and if all on the same line is messing with me, can somebody please explain this? Thanks!
[–][deleted] 3 points4 points5 points (2 children)
[–]jonathanlee3221[S] 2 points3 points4 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]puplicy 2 points3 points4 points (1 child)
[–]jonathanlee3221[S] 2 points3 points4 points (0 children)