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
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
5.connect the values in the list
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
7. how to point to differences, as shown below
8.the list is expanded as follows and the more efficient method is the extended method
9.summary
8. use of print
9.use of sentences,
in the last statement,(10),it is the parameter of the incoming function
9. no appropriate key value
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
11.summy
1.‘while’ infinite cycle and termination ,one of ‘ctrl_c’ is termination .as shown below
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
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
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.
17. ‘break’ is to jump out of the loop.
14. in python, while can cooperate with ,so while–else forms a cycle and jumps out of while–else when using break.
15.
16. ’else‘ can be nested into variou loops
as shown below
17. traversal of dictionaries
18. print-only dictionary keys and print-only dictionary values are shown below.
19.
20.
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.
19.
20. the range() function can help us generate a sequence,but it;s not a list type
21.
22. enumerate(x),can output its index value
23.
24. in for x,y in range (): x,y is a tuple with parentheses omitted.
25. summary
26.
相关文章: