1.python’s type binding is numerically independent of variables
2.assignment of tuples and lists,string,as follows
(1)so long as the number on bith sides are the same,there will be no problem
(2) essentially sequence assignment
python's statement, expressions and if branches
python's statement, expressions and if branches
python's statement, expressions and if branches
python's statement, expressions and if branches
3.an assignment method: extended sequence unpacking assignment,
(1)note that after unpacking ,a list is returned
(2)whether the number is more or less than the variable, the assignment can be successful an asterisked variable always returns a list(sometimes an empty list). an asterisk can only have one and can not appear more than once
python's statement, expressions and if branches
python's statement, expressions and if branches
5.connect the values in the list
python's statement, expressions and if branches
6. when an object is referenced by multiple variables, it can be modified by any variable, pointing to the object ,and the value of the variable pointing to the object changes accordingly as shown below
python's statement, expressions and if branches
7. how to point to differences, as shown below
python's statement, expressions and if branches
8.the list is expanded as follows and the more efficient method is the extended method
python's statement, expressions and if branches
9.summary
python's statement, expressions and if branches
python's statement, expressions and if branches
8. use of print
python's statement, expressions and if branches
python's statement, expressions and if branches
9.use of sentences,
in the last statement,(10),it is the parameter of the incoming function
python's statement, expressions and if branches
9. no appropriate key value
python's statement, expressions and if branches
python's statement, expressions and if branches
10.(1) ‘if’ statements and ternary operators are ultimately intended to produce a result (assigning values to the target)
(2)the sentence annotated in the figure below has the same meaning as the selected sentence
python's statement, expressions and if branches
11.summy
python's statement, expressions and if branches
1.‘while’ infinite cycle and termination ,one of ‘ctrl_c’ is termination .as shown below
python's statement, expressions and if branches
10. strings can also be conditional judgement statement,if the string has a value, it is ‘true’ and if it has no value, it is ‘false’
11. the same is true for lists. whiche return true if they have values and false if they do not have data in some cases
12. the int type is not 0 to true and 0 to false
13. None is also a false
python's statement, expressions and if branches
15.‘pass’ is a placeholder, that is to say, the location to write things but not yet write a place, if not write here grammatical error
python's statement, expressions and if branches
16. ‘continue’ is to jump out of this cycle, that is to say, after continue in the body of the cycle it does not execute,returns to the head of the cycle, and then enters the cycle.
python's statement, expressions and if branches
17. ‘break’ is to jump out of the loop.
python's statement, expressions and if branches
14. in python, while can cooperate with ,so while–else forms a cycle and jumps out of while–else when using break.
15. python's statement, expressions and if branches
16. ’else‘ can be nested into variou loops
as shown below
python's statement, expressions and if branches
17. traversal of dictionaries
python's statement, expressions and if branches
python's statement, expressions and if branches
18. print-only dictionary keys and print-only dictionary values are shown below.
19. python's statement, expressions and if branches
20. python's statement, expressions and if branches
21. because the dictionary keys are printed out in disorder you can put them in the list if you want to adjust the order.
17. you can use the for loop to find the same part of two strings。the code is as follows
18. python's statement, expressions and if branches
19. python's statement, expressions and if branches
20. the range() function can help us generate a sequence,but it;s not a list type
21. python's statement, expressions and if branches
22. enumerate(x),can output its index value
23. python's statement, expressions and if branches
24. in for x,y in range (): x,y is a tuple with parentheses omitted.
25. summary
26. python's statement, expressions and if branches

相关文章: