Python reading notes

Source: Internet
Author: User

Python has six standard data types:

1.Number (digital): Int,float,bool,complex

2.String (String)

3.Tuple (Ganso)

4.List (list)

5.Dictionary (dictionary)

6.Sets (Collection)

Iterators:

The iterator object is accessed from the first element of the collection until all of the elements have been accessed and finished. Iterators can only move forward without backing back.

Two basic methods:iter () creates an iterator object and next element of the next () output iterator .

Generator:

Function:

A piece of code that is organized, reusable, used to implement a single, or associated function.

Indefinite length parameter

Variable names with an asterisk (*) will hold all unnamed variable arguments. If a parameter is not specified when the function is called, it is an empty tuple. We can also not pass unnamed variables to the function

anonymous functions:lambda

variable scope: global variable local variable

Module:

A module is a file that contains all of the functions and variables that you define, followed by a. PY name.

1. Import 2.from...import 3.from...import * (all available methods and variables in the import module) 4. In-depth module (use Import to directly import the name of the module (function, variable) into the current operating module): from F IBO Import Fib,fib2

Package: A package is a form of managing a Python module namespace, with a "point module name".

Python reading notes

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.