赞
踩
这取决于你想要的具体实现,但是一般来说,你可以使用像NumPy这样的库来实现:import numpy as np# 二维坐标 x = np.array([1, 2])# 转换为三维坐标 y = np.append(x, 0)print(y) # 输出:[1, 2, 0]