I have started studying electronics recently, and I came up with a circuit made up of 2 LEDs and 3 buttons.
Here 's how it works: 2 buttons (`red` and `blue`) are connected to the LEDs (`red` and `blue` respectively). Buttons pressing pattern will be remembered and represented through the LEDs when the third button is pressed.
 - Only one LED can blink at a time.
 - The LED will only blink once even if the button is held down.
 - The button must be released to be pressed again.
 - If a button is pressed while the other button is being held down, it will be ignored.
 - If two buttons are pressed simultaneously, the red button will be preferred.
 - If a button is released while the other is being held down, the other 's LED will blink.
 - `0` is up and `1` is down.
 - The two inputs will always have the same length.
Here is an example:
```Python
Red:  "10011010"
Blue: "10110111"
#=> "RBRB"
Red:  "01001000"
Blue: "01011100"
#=> "RB"
Red:  "01101000"
Blue: "00111000"
#=> "RB"
```
PS:
This is my first time making a kata, so there may be some errors. 
You may report to me if the description is too confusing. 
Sorry for my poor grammar.
def button_sequences(seqR, seqB):
    # You may code here
    seq = ''
    leds = ['R','B']
    action = [None,None]
    for r,b in zip(seqR,seqB):
        r = int(r)
        b = int(b)
        for ind,button in enumerate([r,b]):
            if button and not action[ind]: action[ind] = 'press'
            elif button and action[ind]: action[ind] = 'held'
            elif action[ind] and not button: action[ind] = 'release'
        for ind in [0,1]:
            if (action[ind] == 'press') and (action[ind-1] != 'held'): 
                seq += leds[ind]
                break
            elif (action[ind] == 'held') and (action[ind-1] == 'release'):
                if seq[-1] == leds[ind]: continue
                seq += leds[ind]
                break
        
        
        if action[0] == 'release': action[0] = None
        if action[1] == 'release': action[1] = None
    return seq
def button_sequences(seqR, seqB):
    # You may code here
    seq = ''
    leds = ['R','B']
    action = [None,None]
    for r,b in zip(seqR,seqB):
        r = int(r)
        b = int(b)
        for ind,button in enumerate([r,b]):
            if button and not action[ind]: action[ind] = 'press'
            elif button and action[ind]: action[ind] = 'held'
            elif action[ind] and not button: action[ind] = 'release'
        for ind in [0,1]:
            if (action[ind] == 'press') and (action[ind-1] != 'held'): 
                seq += leds[ind]
                break
            elif (action[ind] == 'held') and (action[ind-1] == 'release'):
                if seq[-1] == leds[ind]: continue
                seq += leds[ind]
                break
        
        
        if action[0] == 'release': action[0] = None
        if action[1] == 'release': action[1] = None
    return seq