Baidu's interviewer askedString a= "ABC";String B=new string ("ABC");These two values, a, B are equal, if all go inside HashSet, can put down?A: A==b, but A.equals (B) is equal, because it is equal, so all go to hashset inside, can only put aThis
absrtact : When writing Python scripts, if we use Python to process Web page data or work with Chinese characters, this error message often occurs: syntaxerror:non-ascii character ' \ Xe6 ' in file./filename.py of Line 3, but no encoding declared.
A good article on STR and Unicode
To sort out the Python code-related content
Note: The following discussion is for the python2.x version, py3k to be tried
Begin
When handling Chinese in Python, read files or messages, HTTP parameters, and so on
may be low or record:
The use of STR and REPR
STR is a type (int, long is similar), and she can also act as a string for a factory method instance
Repr is a python-built function that preserves the true state of a printed value in a
may be low or record:
Use of STR and REPR
STR is a type (int, long, similar), and she can also act as a factory method instance of a string
Repr is a python built-in function that preserves the true state of a printed value in a Python
Python uses str & repr to convert the string, pythonstr
It may be better to record low:
Use of str and repr
Str is a type (int, long is similar). It can also be used as a string for a factory Method Instance.
Repr is a built-in function of
In Python processing Chinese, reading files or messages, if found garbled (string processing, read and write files, print), most people's practice is to call Encode/decode for debugging, and did not explicitly consider why garbled, today we discuss
Tag: REF has a bool time detail equal to span spaceStacks and heaps (heap) are places that Java uses to store data in RAM. Unlike C + +, Java automatically manages stacks and heaps, and programmers cannot directly set up stacks or heaps. The
Str and bytes in the Python3Unlike python2.x, python3.x strictly distinguishes between two types of str and bytes. The text is Unicode, represented by the STR type, and the binary data is represented by bytes.python3.x does not mix str and bytes in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.