shorter and IMHO better Python solution

shorter and IMHO better Python solution