I'm porting short python code to c# but I stopped on this line, I don't know what does it mean
array.append( ("%x" % value)[-1] )
anyone? thx
This: "%x" % value gives you a string containing the value number represented in hexadecimal.
The [-1] gives you the last character of the above.
array.append adds that character to the end of array (which is presumably a list).
You can figure this out by messing around with the Python REPL:
>>> "%x" % 142
'8e'
>>> ("%x" % 142)[-1]
'e'
>>> array = []
>>> array.append(("%x" % 142)[-1])
>>> array
['e']
That's the same of doing it:
array.append(str(hex(value))[-1])
hex() converts an integer number (of any size) to a lowercase hexadecimal string prefixed with “0x”.
[-1] gives you the last char of a string.