The first day of formal learning python

  • pycharm install and simple to use
    • Supporting the development of software, code line by line debugging, high-end design
  • Compiled: disposable compiled into binary, and then executed.

Advantages: high efficiency.

Disadvantages: can not cross-platform.

Representatives language: c

  • Interpreted: Progressive interpreted as a binary, and then executed.

Advantages: cross-platform, high development efficiency.

Disadvantages: low efficiency.

Representatives Language: python

  • Coding acquaintance

    Computer storage file, storing data, and sent across the network, the underlying transmission data are stored 01010101.

    First edition: No Dan;

    110 I

    111 and

    101 you

    second edition:

    0000110 I

    0000111 and

    0000101 You

    Codebook: The relationship between binary and text 0101011001

    The earliest this password:

    1.ASCII code: only contain letters, numbers, special characters (8).

    Seven segment can represent 128 different characters, 7 2 **

    0 000 000: a

    0 000 000: b

    ASCII code set aside a total of eight, 8 bit is 0;

    I.e., one byte 0000 0001 is called: 8bit = 1byte (bytes)

    1. China: gbk (can represent up to 2 ** 16 Chinese, namely 65535): contains only letters, numbers, special characters (ASCII) and Chinese, also known as GB (national standards); a letter with a byte , a Chinese two bytes.

    3.Unicode: Unicode: all the text on the world record this password to this.

    Initially, a character represented by 2 bytes:

    0000 0001 0000 0011 : a

    Later, to cover all, with 4 bytes, it can represent 2 ** 32 = 4,294,967,296 characters.

    But the world's full text of no more than 2 ** 21 characters

    utf-8: Minimum represented by one byte characters (English), European by 2 bytes, three bytes Chinese

    'We 12ax': GBK: 8 bytes

    'We 12ax': UTF-8: 10 bytes

    Unit conversion:

    8bit = 1byte

    1024byte = 1kb

    1024kb = 1MB

    1024MB = 1GB

    1024GB = 1TB

    1024TB = 1PB There EB ZB YB NB common enough to TB

  1. variable:

    • Numbers, letters, underscores in any combination.
    • You can not begin with a number
    • You can not use python Keywords: print, if ......
    • You can not use Chinese
    • Descriptive
  2. Variables and data types of differences:

    •  name = 'a'
       name = 'b'
       print(name)
       name = 'c'
       print(name)
    • Steady

      • It has been the same amount, with almost the same variable.

        python using all uppercase letters, said:

        NAME='a'#放在代码最前方,提示人此变量不可更改(实际上可以更改)
  3. Basic data types:

    • 1,2,3,3002, int digits, + -? % ** ......
    • 'Fasz be 2' str string + * int
    • True False boll Boolean value
  4. A user input input ()

  5. if (top to bottom are performed to meet the conditions of one code block, wherein if the flow exit)

    • if conditions:
    • if else:
    • if elif elif ....
    • if nested
  6. while loop

    • why:

    • how:

      The basic structure:

      while 循环条件:
          循环体
      • First determine whether the conditions True

      • If it is True, then enter the body of the loop

      • Cycle and then determine the conditions, if it is True, then re-enter the cycle, if it is False then exit the loop.

    • Terminator Cycle:

      • Changing conditions
      • break: exit the loop
      • continue: terminate this cycle into the next cycle.
    • while else: if not terminated break while the else statement will be executed, while if the break is terminated, break statements are executed.

      count=1
      while count<=3:
          print(count)
          count+=1
      else:
          print('我被执行了')
      
      count=1
      while count<=3:
          print(count)
          break
      else:
          print('我被执行了')#此句未被执行

Guess you like

Origin www.cnblogs.com/wby-110/p/12483012.html