python3 Foundations "Glossary (2)"

51. Programming:

  Let instructions executed by a computer.

52. Code:

  Let the computer to execute the command.

53. underlying programming language:

  Compared with the high-level language, closer to the binary language.

54. The high-level programming languages:

  Easy to understand language reads like English.

55. The assembly language:

  Difficult to read and understand the programming language.

56.Python:

  (This I do not nonsense,

Rookie Tutorial: https: //www.runoob.com/python/python-tutorial.html)

57. Functions:

Accept input, output and execute the statement.

 

58. practice:

  Generally accepted way.

59. call:

  Program input parameters so that the normal output.

60. parameters:

  The data transfer function.

61. Required parameters:

  Non-optional parameters.

E.g:

. 1  # X is a mandatory parameter 
2  DEF asd_ww (X, Y =. 1 ):
 . 3      return X- Y
 . 4  
. 5 V = asd_ww (. 3 )
 . 6  Print (V)
 . 7  
. 8 >> 12 is

62. Optional parameters:

  The argument is not to offer.

E.g:

. 1   # Y is optional and 
2   DEF asd_ww (X, Y =. 1 ):
 . 3       return X- Y
 . 4  
. 5 V = asd_ww (. 3 )
 . 6   Print (V)
 . 7  
. 8 >> 12 is

 

63. Built-in functions:

   Python built-in functions.

E.g:

1  # Check current built-in functions of the python interpreter 
2  Import keyword
 . 3  
. 4  Print (keyword.kwlist)
 . 5  
. 6 >> [ ' False ' , ' None ' , ' True ' , ' and ' , ' AS ' , ' Assert ' , ' the async ' , ' the await ' , ' BREAK ' , ' class ' ,'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']

 

64. Scope:

   Range of variables can be read.

65. The global scope:

  Variables can be read in the whole program.

66. Global variables:

  We have global effect of variables.

E.g:

1 x=1
2 y=2
3 
4 print(x)
5 
6 >>1

 

67. The local scope:

  Read only variable in a function (or class) which was defined in the scope.

E.g:

. 1  DEF F ();
 2      A. 1 =     # local variables within the defined function, the function can only be called in 
. 3      B = 2
 . 4  
. 5  Print (A)    # attempt to call out the function 
. 6  
. 7 >> NameError: name ' A '  IS  not defined   

 

68. exception handling:

  Detect an error condition, if they meet the definition of conditions, catch the exception and decide how to proceed.

E.g:

. 1 A. 3 =
 2 B = 0
 . 3  # Print (A / B) # If this line runs directly occurs 'ZeroDivisionError' error 
. 4  the try :
 . 5      Print (A / B)
 . 6  the except the ZeroDivisionError:     # List errors that may occur 
7      Print ( " you make a mistake! " )
 8  
9 >> make a mistake!

 

69. Documents string:

  Interpretation function function, a string parameter type recorded.

E.g:

. 1  DEF F (x, y):
 2      "" " 
. 3      returns the value of x + y is
 . 4      : param x: int
 . 5      : param y: int
 . 6      : return: int, product of x and y is
 . 7      " "" 
. 8      return x * y

 

70. The method:

  Function closely associated with the specified data type.

71. iterable:

  It refers to the object can not use a loop element itself is accessed.

E.g;

 1 a="ajshfdsh"
 2 i=0
 3 for i in a:
 4     print(i)
 5 
 6 >>
 7 a
 8 j
 9 s
10 h
11 f
12 d
13 s
14 h

 

72. iterables:

  Objects may be iterative, such as strings, lists, and elements.

73. The index (index):

  The representative position of the element in the iterable.

E.g:

1 a=['a','b','c']
2 s=a.index('b')
3 print(s)
4 
5 >>1

 

74. Variable:

  The contents of the container can vary. Such as a list (list), Dictionary (dic)

75. immutable:

  Change the contents of the container can not occur. The tuple (tuple)

76. Dictionary (dic):

  A built storage container object with the corresponding 'key' and 'value. "

E.g:

1 a={'name':'xiaoming','age':18}

 

77. Key:

  It is used to find the value corresponding to the dictionary.

E.g:

1 a={'name':'xiaoming','age':18}
2 
3 print('name')
4 
5 >>xiaoming

 

78. values:

  Dictionary median mapped keys.

79. Mapping:

  An object connected to the other object.

80. The key-value pairs:

  Dictionary median mapped to.

81. Negative Index:

  From right to left may find elements (normal order is from left to right) iteration object.

E.g:

1 a=['a','b','c']
2 s=a[-1]
3 print(s)

 

82. Escape:

  Characters have special significance in python, tells the program is not executed. Such as:" ",#

83. Slice:

  Iteration will be a subset of objects, create a new iterable.

E.g:

1 a=['a','b','c']
2 
3 print(a[0:2])
4 
5 >>['a', 'b']

 

84. The starting index:

  Beginning slice of the index.

85. The end index:

  End index slices.

86. cycle:

  When the code does not define conditions for implementation of a code.

E.g:

1  # Dead cycle 
2  the while True:
 . 3          Print ( ' Hello World ' )

 

87. traversal:

  For each element of loop iteration object.

88.for cycle:

  In a loop iteration object.

E.g:

1 a="123"
2 i=0
3 for i in a:
4     print(i)
5 
6 >>1
7 2
8 3

 

89. The index variable:

  Variable is the position of the element to be iterative.

90.while cycle:

  As long as the expression evaluates to True loop execution would have been down.

E.g:

1 while True:
2     print(‘123’)
3 
4 >>123
5 123
6 123
7 123
8 ...

 

91. infinite loop:

  Never loop termination.

92.break statement:

  To terminate the cycle.

E.g:

1 while True:
2     print("123")
3     break
4 
5 >>123

 

93. The outer loop:

  Comprising inner loops nested loops.

E.g:

. 1 A = [l, 2,3 ]
 2 B = [4,5,6 ]
 . 3 C = []
 . 4  for I in A: # external circulation
 . 5      for J in B: inner loop #
 . 6          c.append (I + J )
 . 7  
. 8  Print (C)
 . 9  
10 >> [. 5,. 6,. 7,. 6,. 7,. 8,. 7,. 8,. 9]

 

94. The inner loop:

  In another nested loop cycle.

95. Module:

  python file contains code that nickname.

96. Built-in modules:

  python built-in module.

97. Import (import):

  Import module. Such as: import keyword

98. The read (reading):

  Data Access file.

99.写(writing):

  Add or modify data in the file. 

100.with statement:

  A composite statement, statement when executing the line, the next line of behavior is performed automatically.

E.g:

1 with open(“a.text”,"w")as f:
2     f.write("hello world")

101.CSV file:

  Suffix .CSV file, commonly used for management reporting procedures (eg: Excel).

 

Guess you like

Origin www.cnblogs.com/wangwenchao/p/11323414.html