完成作业321

This commit is contained in:
2509165005
2026-04-21 11:25:12 +08:00
parent 4892ed88c3
commit ea4699acbc
3 changed files with 58 additions and 0 deletions

15
题目3.py Normal file
View File

@@ -0,0 +1,15 @@
import numpy as np
A = np.array([3, 4])
B = np.array([1, 2])
A_plus_B = A + B
print("1. A + B =", A_plus_B)
two_A = 2 * A
print("2. 2 * A =", two_A)
norm_A = np.linalg.norm(A)
print("3. 向量 A 的长度 =", norm_A)
print("-" * 40)