python face questions No1

Recently a little time out every day to brush python interview questions, would like a little bit of recording down through the blog, come on! Face questions and answers on the Internet to look and added some of their own understanding, but also look if there is insufficient guidance.
  1. Common HTTP status codes What?

200 successful request

301 permanent redirect

302 temporary redirect

400 request parameter error

403 does not have permission

404 page not found request

405 Request wrong way

500 server error (code appears bug)

502 nginx uwsgi other services linked to the  

  2. explanation assignment, shallow copy and deep copy?

Assignment: Assignment just a simple reference to the object, does not create a new object, point to the same memory space simply assigned only to the original object from a new alias;.

Shallow copy: Shallow copy is not a reference to the original object, will create a new object, does not point to the same memory space; shallow copy copy only the first layer of the object, the original object element will change when the object element occurs in change;

Deep copy: deep copy will create a new object, does not point to the same inner space, deep copy copies all the elements of objects, including multiple levels of nested elements of the original object does not change when the element occurs so objects in change.

 Note: For a non-container type without said copy; variable comprises only if the tuple type atom is not a deep copy.

  3. How many operators have in python? And a brief description.

1. Arithmetic operators: +, -, *, /, //,%, **

2. assignment operator: =, + =, - =, * =, / =, ** = // =

3. The logical operators: and, or, not

4. Relational operators: =, =,>, <,> =, <=,!

The members of the operator: in, not in

6. The identity of the operator: is, not is

7. bitwise operators: &, |, ~, ^

8. Bitwise Operators

  == difference 4.python and is in the?

It is determined whether the two objects are the same object, the id is determined (whether or not point to the same memory space)

== Analyzing the two values ​​are equal the object, is determined by the value

  5. HTTP and HTTPS difference?

1.https agreement ca need to apply for permits, generally less free certificate.

2.http is hypertext transfer protocol, information is transmitted in the clear, https is encrypted with a security ssl transfer protocol.

3.http and use is completely different https connection, with the port are not the same, the former is 80, which is 443.

4.http connection is very simple, is stateless; is constructed by the HTTPS protocol SSL + HTTP encrypted transmission protocol, a network authentication protocol, the http protocol than security.

Guess you like

Origin www.cnblogs.com/longpy/p/11028369.html
Recommended