I want to imply a condition to the inputs I am using. Example: if_button_b.was_displayed #and target number = 5 then display.show("win") Basically, what I want to do is: #if button b is pressed on 5 in the counting then display win, if not display lose.
closed as off-topic by Ingo, Milliways, Dmitry Grigoryev, Ghanima♦ Mar 9 at 16:38
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – Ingo, Milliways, Dmitry Grigoryev, Ghanima
You can use the word
and between conditionals, e.g:
if button_a.is_pressed and button_b.is_pressed: print("both pressed") elif button_a.is_pressed: print("a pressed") elif button_b.is_pressed: print("b pressed")