I have if statement
if "1111111" in players or "0000000" in players or "blablabla" in players:
do something
How to write in short ?
if any(x in players for x in ("1111111", "0000000", "blablabla")):
# do something
If you are going to be doing a lot of these membership checks you may consider making players
into a set
which doesn't need to potentially traverse the entire sequence on each check.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With