Rules Engine Python W3schools Exercise