How to do it in Python