lambda i: print(i),["%d even"% i if i % 2 == 0 else "%d odd"% i for i in random.sample(range(100), 10)]
What is wrong with this code, it is not printing anything.
If I try to print by using another function, it is working fine. But I am trying to add printing code also in the same statement.
Following code worked for me,
map(lambda i: print(i),["%d even"% i if i % 2 == 0 else "%d odd"% i for i in random.sample(range(100), 10)])