"Glossary" based on Python 3

Posted by mooler on Tue, 13 Aug 2019 15:38:53 +0200

51. Programming:

Instructions for the computer to execute.

52. Code:

Commands to be executed by a computer.

53. The underlying programming language:

Compared with advanced languages, it is closer to binary languages.

54. Advanced programming languages:

It reads like an easy-to-understand language in English.

55. Assembly Language:

A programming language that is difficult to read and understand.


I won't talk nonsense about this.

Newbie Course: https://www.runoob.com/python/python-tutorial.html

57. Function:

Accept the input and execute the output result statement.


58. Practice:

A generally accepted approach.

59. Call:

Make the input parameters of the program output normally.

60. Parameters:

Data passed to a function.

61. Required parameters:

Non-optional parameters.

For example:

1 #x As a required parameter
2 def asd_ww(x,y=1):
3     return x-y
5 v=asd_ww(3)
6 print(v)
8 >>12

62. Optional parameters:

Non-mandatory parameters.

For example:

1  #y As an optional parameter
2  def asd_ww(x,y=1):
3      return x-y
5 v=asd_ww(3)
6  print(v)
8 >>12


63. Built-in functions:

Python's own functions.

For example:

1 #View the current python Interpreter built-in functions
2 import keyword
4 print(keyword.kwlist)
6 >>['False', 'None', 'True', 'and', 'as', 'assert', 'async', '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:

The range within which variables can be read and written.

65. Global scope:

Variables can be read and written throughout the program.

66. Global variables:

Variables with global effects.

For example:

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


67. Local scope:

The scope of a variable that can only be read and written in the function (or class) where it is defined.

For example:

1 def f();
2     a=1    #Define local variables within a function, which can only be called within a function
3     b=2
5 print(a)   #Trying to call outside of a function
7 >>NameError: name 'a' is not defined   


68. exception handling:

Detect error conditions, catch exceptions if they meet the defined conditions, and decide how to handle them.

For example:

1 a=3
2 b=0
3 # print(a/b) #If you run this line directly, a Zero Division Error error will occur.
4 try:
5     print(a/b)
6 except ZeroDivisionError:    #List possible errors
7     print("Input error!")
9 >>Input error!


69. Document string:

Explain the function function and record the string of its parameter type.

For example:

1 def f(x,y):
2     """
3     Return x+y Value
4     :param x:int
5     :param y:int
6     :return:int,x and y Product
7     """
8     return x*y


70. Methods:

Functions closely related to the specified data type.

71. Iterative:

Objects can use loops to access none of their own elements.

For example;

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


72. Iterable objects:

Iterative objects, such as strings, lists, and elements.

73. index:

Represents the position of elements in an iterative object.

For example:

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


74. Variable:

Contents in containers can change. For example, list, dictionary (dic)

75. Invariant:

The contents of the container should not change. tuple

76. Dictionary (dic):

A built-in container for storing objects with corresponding keys and values.

For example:

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


77. Key:

Used to find the corresponding value in the dictionary.

For example:

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


78. Value:

The value of the mapping key in the dictionary.

79. Mapping:

Connect one object to another.

80. Key-value pairs:

Mapping to values in a dictionary.

81. Negative index:

Look for elements in an iteratable object from right to left (the normal order is left to right).

For example:

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


82. Transliteration:

Characters with special meaning in python tell the program not to execute. For example: ",""#

83. Section:

Create a subset of iteratable objects into a new iteratable object.

For example:

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


84. Initial index:

Start slicing indexing.

85. End Index:

End slice index.

86. Cycle:

Continuous execution of a piece of code when the code does not meet the definition criteria.

For example:

1 #dieloop
2 while True:
3         print('hello world')


87. Traverse:

Use a loop to iterate over each element in the object.

88.for cycle:

A middle loop of an iterated object.

For example:

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


89. Index variables:

The value of the variable is the position of the iteratable object element.

90.while loop:

As long as the result of the expression is True, the loop continues.

For example:

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


91. Dead cycle:

A cycle that never ends.

92.break statement:

Used to terminate the cycle.

For example:

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


93. External circulation:

A cycle that contains nested loops.

For example:

 1 a=[1,2,3]
 2 b=[4,5,6]
 3 c=[]
 4 for i in a:  #External circulation
 5     for j in b:  #Internal circulation
 6         c.append(i+j)
 8 print(c)
10 >>[5, 6, 7, 6, 7, 8, 7, 8, 9]


94. Internal circulation:

A loop nested in another loop.

95. Module:

python file alias with code.

96. Built-in modules:

python built-in modules.

97. import:

Import module. For example: import keyword

98. reading:

Access the data in the file.

99. Write:

Add or modify data in a file.  

100.with statement:

A compound statement that automatically executes the behavior of the next line when one line of statement is executed.

For example:

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

CSV file:

Files suffixed with. CSV are often used as report management programs (e.g. Excel).


If there are any shortcomings, please correct them.

Topics: Python Programming Assembly Language Lambda