Um, I'm actually KrazyKitsune, I'll use that account after I manage to recover my password.
So I'm having trouble with RS NOR latches. I did this:
s = int(raw_input("set Set value: ")) r = int(raw_input("set Reset value: ")) qi = not (s or q) q = not (r or qi) print q, qi
But the problem is...
If I do s = 1 and r = 0, it works fine and returns True (for Q) and False (for Q inverse). But if I do s = 0 and r = 1, it returns an error stating that the local variable 'q' was referenced before its assignment. I understand the error, but I don't know how to fix it.
If I switch qi = not (s or q) with q = not (r or qi), it becomes the other way around. s = 0 and r = 1 works, and s = 1 and r = 0 returns an error.
And a note: I'm trying to use only boolean expressions.