Please enable JavaScript.
Coggle requires JavaScript to display documents.
Python Lecture4 (if statement : (the condition line starts with if, the…
Python Lecture4
if statement :
-
-
-
just like for loops, the body is indented
-
after else, we need have the colon
numpy to create a array
firstly, we need to import numpy,
for example: import numpy as np.
if we need the table content, we can
a=np.array([[1,2,3],[4,5,6]])
a=np.zeros((colon, row)) b=np.ones((colon,row))
a=np.full((colon,row),number) you will get a table which all have number.
e=np.random.random((2,2)) 生成随机数
-
-
Fun thing to do?
-
.insert(number,"") use this method can insert content in any position in this list
.sort() can make list have order, change directly this variable
-
.pop() default remove the last one in the list,
.pop(number,"") you can also remove the any element in this
ID=XX.pop() can get the remove one;list :
-
-
-