p10 in Python & Java