[ad_1]
>>> l = [0.01, 0.1, 0.4, 0.034, 0.6, 0.7, 0.9, 1]
>>> [0.4 if (0. < f < 0.5) else 0.7 for f in l]
[0.4, 0.4, 0.4, 0.4, 0.7, 0.7, 0.7, 0.7]
[ad_2]
solved Change the numbers of a list to another number python
[ad_1]
>>> l = [0.01, 0.1, 0.4, 0.034, 0.6, 0.7, 0.9, 1]
>>> [0.4 if (0. < f < 0.5) else 0.7 for f in l]
[0.4, 0.4, 0.4, 0.4, 0.7, 0.7, 0.7, 0.7]
[ad_2]
solved Change the numbers of a list to another number python