Built-in functions-2

Source: Internet
Author: User

1. Locals (), Globals ()

These two functions primarily provide a way to access local variables and global variables based on a dictionary.

Http://www.itdadao.com/articles/c15a227289p0.html

2. Hex ()

This function converts a string representation of an integer object to 16, such as a format like 0x.

http://www.aichengxu.com/view/801814

3. ID ()

The ID (object) function is an address that returns an object that is in memory during its life cycle.

http://www.aichengxu.com/view/10509081

4. Unicode class, Str class, basestring:

Basestring is a superclass (parent class) of STR and Unicode, and therefore cannot be invoked and instantiated, but can be used to determine whether an object is an instance of STR or Unicode, isinstance (obj, basestring) Equivalent to Isinstance (obj, (str, Unicode));

5. Lambda, map (), filter (), reduce ()

Map (): Returns a new list

Filter (): Returns a new list

Reduce (): Returns a single value

http://www.python-course.eu/lambda.php

6. Oct (x)

This function is a string that converts an integer x to an octal representation

http://www.aichengxu.com/view/801797

7. Pow (x, y): Returns the Y-square of X

8. Round (float, ndig): Only for floating-point numbers.

Accept a floating-point number float and round it, saving ndig decimal places.

If the Ndig parameter is not provided, the default is 0 digits after the decimal point.

http://www.aichengxu.com/view/4496867

9. Set ()

Https://en.wikibooks.org/wiki/Python_Programming/Sets

The. zip () function takes 0 or more sequences as parameters and returns a tuple list.

The working mechanism is to take the elements from the same location in each list to form a tuple, place them in a list, and return to the list.

http://www.aichengxu.com/view/61372

Built-in functions-2

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.