лямбда, если еще ничего питона

lambda x: x if (x<3) else None
Magnificent Mole