tree = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12],
[13, 14], [], [], [], [], [], [], [], []]
data=[0]
while len(data)>0:
pos=data.pop(0)
print(pos,end=" ")
for i in tree[pos]:
data.append(i)
訂閱:
張貼留言 (Atom)
二維陣列(2d array) matrix
import numpy as np fru_items=[["apple","banana","cherry","durian","eggplant","fig...
-
sympy 用於線性代數 from sympy import * a,b,c=symbols("x,y,z") print(a.name) formu=a+a+b+c print(type(a.name)) print(formu) 結果是 x ...
-
import numpy as np fru_items=[["apple","banana","cherry","durian","eggplant","fig...
-
import math def is_prime(n): if n
沒有留言:
張貼留言