def func(v): return v if v > 4 else type(v)(0) a = [1, 2, 3.4, 5]print(list(map(func, a)))
Standard input is empty
[0, 0, 0.0, 5]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!