完成作业“

;
This commit is contained in:
2509165004
2026-04-21 11:21:47 +08:00
parent 080a0b4948
commit be0a8b60c9
3 changed files with 41 additions and 0 deletions

17
1.py Normal file
View File

@@ -0,0 +1,17 @@
import numpy as np
# 定义向量
A = np.array([3, 4])
B = np.array([1, 2])
# 1. 计算A + B
add_result = A + B
print("A + B =", add_result)
# 2. 计算2 × A
mul_result = 2 * A
print("2 × A =", mul_result)
# 3. 计算A的长度
norm_A = np.linalg.norm(A)
print("A的长度 =", norm_A)