Today contents: 1 . Computer Principle 2 .python basic operations: 1 . Register blog Park 2 . Today, content and work release (dictation) - What is language? Language is the medium of communication between people. - What is the programming language? Programming language is communication between man and computer media. - Why learn programming? Let the machine replace manpower, the service of humanity. **** : What is software (programs)? A pile of documents consisting of text inside is a bunch of code. - five components of computers :( default) - the CPU: + Control operation (corresponding to human brain) - the memory: a storage device for temporarily storing data. Powered data exists, power data loss. - hard drive (external memory): used to permanently store data, power is not lost. - input devices: keyboard, mouse, ... - output devices: displays, audio ... - OS: -windows: Microsoft's operating system, generally used for office work, entertainment (movies, play games). - Mac: Apple's operating system, generally used for office, with pictures and video ... - Linux: for the operating system as a server. - Programming Language Category - machine language: refers to the machine directly you can read text, binary form of expression. 0101010111011101110001 010 : Your 010 : U 10101110 : handsome advantages: high efficiency Disadvantages: the development of efficient low - assembly language: Alternative binary by some of the characters, in order to improve development efficiency. A: 1,010,101,011 advantages: the efficiency slightly. (Low compared to machine language) Disadvantages: low efficiency of development. - high-level language: Closer to human language called high-level language. It is best able to understand the human character. For example: python \ java \ C ... advantages: high development efficiency. Disadvantages: efficiency, lower than the machine assembly language. - compiled language: similar Xinhua Dictionary, the Oxford English Dictionary. Advantages: high efficiency. Disadvantages: low efficiency of development. - interpreted language: similar to simultaneous interpretation, while the implementation side translation. Advantages: high development efficiency. Disadvantages: low efficiency. Note: The computer can only recognize binary characters. Python: is an interpreted language. Python: 1 written in python code in two ways: - Interactive environments: temporary valid, invalid closed. - python file (******* ) permanently save python code, all files are python .py file. Py file creation steps: -> project folder right-click -> New -> python File (write the name python file) 2 execute python code things will happen: 1 ) to execute the python interpreter, load python interpreter. 2 ) to load the python file into memory. 3 ) perform python code. 3 . Variable variable amount is variable, the equivalent of human memory. Note: The first definition, after the call. - variable name: variable values and binding relationship, the equivalent of house number variable values. - = : variable name and a variable value bind - variable values: generating in memory, the effective power, to power loss. 4 .python data type type (variable name): used to view data types. ,
Print ( ' Anhui Institute of Finance and Trade is very powerful ' ) # define a variable: # name: variable name # =: used to bind variable name and variable value # 'Lu overall': the value of the variable name = ' General Lu ' Age = 21 Sex = ' FEMALE ' # call variable Print (name, Age, Sex) '' ' python8 big data type: - integer (integer): int 18 is used to store identification ID, age .. - float (decimal): a float 15.5, 1.9 store pay height - the string must be caused by a single or double quotes, triple quotes - Boolean True: True, False: False - the list in brackets [], brackets can store multiple variables, each separated by commas. Note: The comma must be in English input method. Value: The name list [index] - tuples parentheses (), a plurality of values can be stored in parentheses, each of the values separated by commas Note: The list can be modified value tuples not. - set {1, 2, 3 ...} braces {} brackets separated by commas, can store multiple values. Built-in deduplication functionality. - dictionary braces {} brackets separated by commas, can be stored a plurality of values, but the values are in each key: value stored in the form. Note: a dictionary key must be unique. Key {: value, key2: value} '' ' # Integer Age = 18 is Print ( ' Age ---> ' , Type (Age)) # float height = 1.9 Print ( ' height ---> ' , type (height)) # character name = ' Tank ' Print ( ' name ---> ' , type (name) ) # Boolean value # determine the variable name and variable value is equal tank1 Print (name == ' Tank ' ) # True Print ( ' BOOL ---> ' , of the type (name == ' Tank ' )) # True # list = List1 [ ' Tank ' , 18 is, ' MALE ' ] Print (List1) Print ( " List1 ---> ' , type (List1)) # 0. 1 names = [ " Wang Ergou ' , ' Li two eggs ' , ] # list value Print (names [. 1 ]) # tuple tuple1 = (. 1, 2,. 3 ) Print ( ' tuple1 ---> ' , type (tuple1)) # set set1 = {1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} print('set1--->' ,type(set1)) # 字典 # key-->"name": value--->'tank', dict1 = {"name": 'tank', 'age': 18} print('dict1--->', type(dict1))