007. Quick Start, learn by the side
008. Variable Type
Print (type (variable)) see the types of variables now commonly used types of variables are integer, float, character type
009. List Base Module
Type conversion: STR (8) converts 8 to a string of value the test character has no way to convert to a character type
010. List index 011, loop structure
Loop condition, in the for loop, called the loop body, the loop body indents 4 spaces or a TAB key
012. Judging structure:
The judging condition has two Boolean values, True and false, if it is true will execute if the content, otherwise do not execute
013, Dictionary module 014, file processing
1. File read, only need to specify two parameters, one is the name of the file, if the file in the current running directory, you do not need to specify the path, otherwise you need to specify the absolute path of the file, the second parameter is the operation of the file eg: "R" is the read operation of the file
The above code can read the contents of the file Test.txt directly f.read () read the contents of the file (read the current environment)
2. Write file operation, when there is this file, write the content in the file, if not, it will automatically create a "Text_write.txt file" and then write the content
3. This is a. csv file
Split () splits the file into lists, such as dividing the 1 sunny first by "\ n" and then following "," to slice
015. Function Basics
Define a function with the keyword DEF
With a colon, followed by indentation
function definitions can have parameters, or they can have no parameters
Chapter No. 02 Python Quick Start