* Ctrl+z And exit() Can close terminal session
* Variable naming :
1. Variable names can only contain letters , Numbers and underscores , And cannot start with a number
2. Variable name cannot contain spaces , But you can use underscores to separate words
3. Don't use it Python Keywords and function names
4. Should be short and descriptive
5. Use small letters with caution l And capital letters O

3. It's all strings in quotes
4 .title() title case
5 .upper() Capitalize all
.lower() Change all to lowercase
6. use + Merge strings
7. Tab \t(=tab)
Line break \n
8 .rstrip() Make sure there is no space to the right of the string
.lstrip() left
.strip() both sides
9.** Power operation
10.str() Change to string
int() Become a number
11.# Comment line
12. list

1. Index from 0 instead of 1 start
2. Index value -1 Point to last element
3. Modify element Direct redefinition
4…append() Add a single element
5…extend() Add each element in one list to another
6…insert() Add new elements anywhere , But you need to specify the index and value of the new element
fruit.insert(0,'apple')
7.del Delete element
del fruit[0]
8…pop() Delete last value , But still accessible
9.remove() Delete the value of an element , Only the first specified value can be deleted
fruit.remove(apple)
10…sort() Permanently sort the list
sorted() Keep the original order , At the same time in a specific order
11…reverse() Reverse list element order , Permanent modification
12.len() Get list length
len(fruit)
13. When an index error occurs and no solution is found , Please try to print out the list or its length
14.for The colon after the statement tells Python, The next line is the first line of the cycle
15.range() Start with the first value you specify , And stop after reaching the second value you specified , So the output does not contain a second value
16.list() Set tuple , String to list
17.min() minimum value
max() Maximum
sum() the sum
18.fruit=my_fruit[:] Generate two lists
fruit=my_fruit Simple replication , Only one list

13. Tuple cannot be modified , But it can be reassigned
14.if sentence

1. each if The core of a statement is a value of True or False Expression for , This expression is called a conditional test
2. Case sensitive when checking for equality
3. Not equal to !=
4. Just want to execute one code block , use if-elif-else structure
Run multiple code blocks , With a series of independent if sentence

15. Dictionaries

1. How to add key value pairs :fruit['apple']=1
2.del Statement delete
3…items() Returns a list of key value pairs
4.Python Do not care about the storage order of key value pairs , Only the relationship between key and value is tracked
5…key() Return all keys
When traversing a dictionary , All keys will be traversed by default
6…values() Return all values
7.set() Build collection , I.e. remove duplicate values

Technology
©2019-2020 Toolsou All rights reserved,
It's unexpected Python Cherry tree (turtle The gorgeous style of Library ) Some East 14 Pay change 16 salary , Sincerity or routine ? Browser kernel ( understand )java Four functional interfaces ( a key , simple )HashMap Explain in detail html Writing about cherry trees , Writing about cherry trees os Simple use of module