Python Logic Gate simulator