Python face question

Source: Internet
Author: User

Python is an interpreted language, and its source code can be run directly. The Python interpreter interprets the source code as an intermediate language and translates it into a machine code run.

1. What's the matter pickling and unpiickling

I understand the serialization and deserialization of objects, using pickle to convert Python objects into binary strings (type bytes), to facilitate file storage objects, and to regain this object using load ().

2.python How to manage memory

Python is a dynamic type of language, reference and object separation, GC in the way of reference counting, cross-reference using the mark-clear method of identification, the use of generational recovery to improve efficiency, in order to reduce the GC-induced system efficiency, automatic recovery needs

Meet certain conditions, detailed memory management click here

3. What tools can help to do static analysis of Python source code

Pychecker can report the error and complexity of the source code, Pylint can detect whether the source code conforms to the programming standard

4. What is a python decorator

The adorner mainly provides aspect-oriented programming technology, which is based on nested function definitions and function closures, and can be wrapped by the @ Syntax sugar Wrapper correlation function. Decorator Introduction Click here

5. The difference between an array and a tuple

Arrays are mutable, tuples are read-only, tuples can be used as dict keys

6. How the value of the parameter is passed and how the reference pass is implemented

Everything in Python is a class, all variables are references to objects, and assignments are equivalent to modifying references, but mutable objects can be modified.

7. List down style, dictionary down style, set down type

Push-down is also called analytic, it can quickly build another new data list from one data list

List push-down basic form [value for value in list if exp]

Generator object (value for value in list if exp)

Dictionary push-down basic form {Key:value for key,value in Dict.items () if exp}

Set down type {key for key in list if}, the collection does not allow the existence of the same element

What data structures are available in 8.python

Variable: list,dict,set, immutable: String,tuple,number

What is the 9.python generator?

A generator is a mechanism for implementing iterators, and its functional implementation relies on yield expressions, in addition to normal functions;

Its working mechanism: a function with yield returns a Iterable object through __next__ each execution to the yield return value, the next time next comes from the yield next sentence continues to execute, until meeting return or function execution end, Throw out the stopiteration without processing;

It feels like the execution process of the association.

Python face question

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.