Simple OTP implementation in Python