Timeline for Tips for golfing in Python
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 31, 2024 at 1:09 | comment | added | Lucenaposition |
@ɐɔıʇǝɥʇuʎs you need ==.
|
|
| May 3, 2023 at 22:27 | comment | added | wihlke | Is there a reason to use this over the standard bitwise operators? | |
| Mar 8, 2022 at 23:45 | comment | added | des54321 |
* unfortunately only works if what youre comparing are bool variables, otherwise you need parentheses, which cuts out any savings over using and, but I have found that >0< actually works as an and, and at least cuts out a byte or two of whitespace
|
|
| Apr 30, 2018 at 20:48 | comment | added | wastl |
* instead of and/&& saves some bytes in many languages.
|
|
| May 31, 2017 at 1:30 | comment | added | CalculatorFeline |
| works in all situations.
|
|
| Apr 23, 2015 at 1:18 | comment | added | undergroundmonorail |
use + for or if you can guarantee a != -b
|
|
| Feb 20, 2015 at 2:35 | history | wiki removed | Doorknob | ||
| Apr 9, 2014 at 7:56 | comment | added | ɐɔıʇǝɥʇuʎs |
Or you could use &: a=b=False, a&b
|
|
| Feb 3, 2014 at 4:27 | history | edited | Mechanical snail | CC BY-SA 3.0 |
added 4 characters in body
|
| Dec 20, 2013 at 6:53 | history | answered | Justin | CC BY-SA 3.0 |