Head First Python Chapter one initial python

Source: Internet
Author: User

1. Install the Python interpreter and IDE, choose Pycharm here, with the environment

2. Examples of the list:

Python has no array, only a list of meta combinations

List examples are as follows

movies=["Titanic", "The Big Bang Theory"]
Print (Movies[0])

List supports operations such as Insert,pop,remove,append

Lists can contain mixed types of data

3.for Each statement is combined with a list

For Each_movie in movies:
Print (Each_movie)

List processing Code python programmer called "group"

4. List nesting

List allows nesting, more flexible than multidimensional arrays

Supports isinstance detection type, such as Isinstance (***,list) to detect if an identifier is a list

Processing multi-level list nesting (removing content from all lists) requires multiple layers of judgment and a for statement-resolution: Recursive?

5.python function

def function name (parameter):

function body

Using recursion to solve a list of multiple nesting problems, recursive default depth of 100, can be changed

Head First Python Chapter one initial python

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.