I am new to python when i try to print "\20%" that is
>>>"\20%"
why is the shell printing '\x10%' that is, it is showing
'\x10%'
the same is happening with join also when is do
>>>l = ['test','case']
>>>"\20%".join(l)
it shows
'test\x10%case'
I am using python 2.7.3
A confusion matrix is a table that is used to define the performance of a classification algorithm. A confusion matrix visualizes and summarizes the performance of a classification algorithm.
Confusion Matrix is a useful machine learning method which allows you to measure Recall, Precision, Accuracy, and AUC-ROC curve. Below given is an example to know the terms True Positive, True Negative, False Negative, and True Negative. True Positive: You projected positive and its turn out to be true.
'\20'
is an octal literal, and the same as chr(2 * 8 + 0) == chr(16)
.
What the Python shell displays by default is not the output of print, but the repr
esentation of the given value, which is the hexadecimal '\x10'
.
If you want the string \20%
, you have to either escape the backaslash ('\\20%'
) or use a raw string literal (r'\20%'
). Both will be displayed as
>>> r'\20%'
'\\20%'
\20
is an escape sequence that refers to the DLE
ASCII character whose decimal value is 16 (20
in octal, 10
in hexadecimal). Such a character is printed as the \x10
hex escape by the repr
function of strings.
To specify a literal \20
, either double the backslash ("\\20"
) or use a raw string (r"\20"
).
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