Furious Python-Article 3-Structure Control, Article 3 structure of python
As we all know, the structure of program statement execution is nothing more than the sequential structure, branch structure, and loop structure. The same is true for Python, and the sequence structure is too simple to mention, briefly record the similarities and differences between branches and loops and C ++. By the way, for those who already know C ++, it should be noted that the statement block is controlled by indentation when learning Python.
Branch Structure: If and else are used, and an additional elif is used to replace the else if of C ++. The essence is the same, so no example is given.
Loop Structure: Compared with C ++, do does not exist .. the until statement, including the while and for statements, uses break to end the loop and uses continue to enter the next loop. However, the for statement and a new statement pass are different. The following is an example, other parts are the same.
For I in 'wyp': # print 'this is 'cyclically through the sequence structure, ifruits = ['apple', 'Banana', 'Orange '] for fruit in fruits: # print 'this is ', fruitfor I in range (3) through the sequence structure: # print 'index for' cyclically through the Index ', fruits [I] pass # pass won't do anything. It's useless.
What is the difference between the third and fourth versions of the Python learning manual? Help
The third version is python2.x, supplemented by 3. x. The fourth version is dominated by 3. x and supplemented by 2. x.
How to learn the English version of PYTHON 3
The book is good, but the third edition is a bit old. We recommend that you read the fourth edition, covering more new things. it is easy to understand and easy to understand. it seems that the author is familiar with c/c ++ ......