python solution for the "ribbe-example"