在Python中,计算两个数A和B的乘积非常简单,你可以使用以下方法之一:
1. 使用 `*` 运算符:
```python
A = 3
B = 4
result = A * B
print(result) 输出:12
2. 使用 `numpy` 库(如果你需要处理矩阵乘法或其他高级数学运算):
```python
import numpy as np
A = np.array([[1, 2], [3, 4]])
B = np.array([[5, 6], [7, 8]])
result_matrix = np.matmul(A, B)
print(result_matrix) 输出:array([[19, 22], [43, 50]])
请根据你的具体需求选择合适的方法。