day01 Computer Fundamentals

 
 
Class Notes:

1. What is language?

    Language is the medium of communication between people.

II. What is a programming language?

    Programming language is communication between man and computer media.

III. Why learn programming?

    Let the machine replace manpower, the service of humanity.

IV. What is software (programs)? ****

    A pile of documents consisting of text inside is a bunch of code.

V. five major components of the computer :( default)

    Ⅰ CPU:. + Control operation (corresponding to the human brain)

    Ⅱ memory: a storage device for temporarily storing data. Powered data exists, power data loss.

    Ⅲ hard disk (external memory): used to permanently store data, power is not lost.

    Ⅳ input devices: keyboard, mouse ...

    Ⅴ output devices: displays, audio ...

Six operating system:

    Ⅰ. 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:

        As the operating system for the server side.

VII. Programming Language Category

    . Ⅰ machine language:

        Refers to the machine directly can read text, binary form of expression.

        0101010111011101110001

        010: Are you 010: u 10101110: commander

        Advantages: high efficiency

        Disadvantages: low efficiency of the development

    . Ⅱ assembly language:

        By some alternative binary characters, in order to improve development efficiency.

        a: 1010101011

        Advantages: higher efficiency. (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:

         Similarly Xinhua Dictionary, the Oxford English Dictionary.

           Advantages: high efficiency.

           Disadvantages: low efficiency of development.

       . ② interpreted language:

         Similarly simultaneous interpretation, while the implementation side translation.

           Advantages: high development efficiency.

           Disadvantages: low efficiency.

         Note : The computer can only recognize binary characters.

 Eight Python:. Is an interpreted language.

 Python:

      1. python code written in two ways:

        - Interactive environments: effective temporary closing invalid.

        - python file (*******): permanent preservation python code, all files are python .py file.

      Py file creation steps: -> project folder right-click -> New -> python file (write python file name)

     2. Do things happen python code:

        1) First run python interpreter, load python interpreter.

        2) to load the python file into memory.

        3) perform python code.

     3. Variables

        Variable is the amount of change, the equivalent of human memory.

        Note : the first definition, after the call.

        Variable name: a binding relationship with the variable value, the equivalent of house number variable values.

        =: Bind variable name and variable value for

        Variable values: generating in memory, the effective power, to power loss.

     4.python data types

      ① integer (integer): int
       for storing identification ID, age ...
      ② float (decimal): a float
        15.5, 1.9
        store payroll Height
      ③ string:
          must, three in single quotation marks or double quotes to
      ④ Boolean:
          true or false (true or false)
      ⑤ list:
          square 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 : listing the values can be changed, not the tuple
      ⑦ set
        braces { }, separated by a comma in parentheses, you may store multiple values. Built-in deduplication functionality.
      ⑧ dictionary
        braces {} brackets separated by commas, can be stored a plurality of values, each value is a key to:. The stored value
      Note : dictionary key must be unique.
            {key: value, key2: value }




Code:
Print

('Anhui Institute of Finance and Trade is very powerful') #define a variable: #name: variable name #=: used to bind variable name and variable value #'Lvlian Jie': the value of the variable name ='Lvlian Jie' Age= 83 Sex='FEMALE' #call variable Print(name, Age, Sex) ... eight types: #integer Age = 18 isPrint('Age --->', type (Age))#float height = 1.9Print('height --->' , Type (height)) # character name = ' Tank ' Print ( ' name ---> ' , type (name)) # Boolean # Analyzing variable name and the variable value is equal tank1 Print (name == ' Tank ' ) # True Print ( ' BOOL ---> ' , type (name == ' Tank ' )) # True # list List1 = [ ' Tank ' , 18 is, ' MALE ' ] Print(List1) Print ( " List1 ---> ' , type (List1)) # 0. 1 names = [ ' Lvlian Jie ' , ' LU Silver Silver ' ,] # 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 ( ' setl ---> ' , type (setl)) # dictionary # key-->"name": value--->'tank', dict1 = {"name": 'tank', 'age': 18} print('dict1--->', type(dict1))
 
 

 

 

 

Guess you like

Origin www.cnblogs.com/858993884-com/p/11574031.html