Python Tips & Tricks
Some tips and tricks you can use to bring up your Python programming
float('inf')
float('inf')
: acts as an unbounded upper value for comparison
inf
is infinitya value that is greater than any other value
-inf
is smaller than any other value
ex)
sys.maxsize
sys.maxsize
: An integer giving the maximum value a variable of type Py_ssize_t can take.
-> It’s usually 231 - 1 on a 32-bit platform and 263 - 1 on a 64-bit platform.
[::-1]
[::-1]
: Reversing an iterable
ex)
Last updated