What is “\00” in Python?
|
What does "\00" mean in Python? To learn more about this, I tried following:
What does |
|
| add comment |
|
In Python 2, when a number starts with a leading zero, it means it's in octal (base 8). In Python 3 octal literals start with The leading The zero byte is also known as the nul byte or null byte. It doesn't display anything when printed -- it's null. See http://www.ascii.cl/ for ASCII character codes. Yes, It's sometimes used for other purposes, see http://en.wikipedia.org/wiki/Null_character. |
|
| add comment |
|
The backslash followed by a number is used to represent the character with that octal value. So your |
|||||
|

浙公网安备 33010602011771号
replacedo ?. Will it merely treat "\00" as a plain string; to be replace by "". – Pankaj Upadhyay Jul 27 '11 at 7:42\0is octal, while\x00is hexadecimal, and both are null. – agf Jul 27 '11 at 16:13