A = [ 1, 2, 3, 4, 5 ] A1 = [ a for a in A if a % 2 ]B = [ a for a in A if a % 2 == 0 ] print(A1)print(B)
Standard input is empty
[1, 3, 5] [2, 4]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!