I saw the syntax below in a tutorial
print("{0:>2} in binary is {0:>08b}".format(100))
I was wondering what does the greater equal sign (>) does?
and is it necessary to use it?
because when I used it like this
print("{0:2} in binary is {0:08b}".format(100))
it produced the same result as the first one I mentioned above
>means right-aligned as opposed to<, left-aligned. Right-aligned is the default for numbers anyway. See docs.python.org/3/library/string.html#formatspec