Easy
Math for AI• Dot product
Implement dot product of two vectors
Given two lists of numbers (vectors), compute their dot product.
The dot product of vectors a and b is: sum(a[i] * b[i]) for all i.
Input: Two lines. First line: space-separated numbers for vector a. Second line: space-separated numbers for vector b.
Output: A single number (the dot product).
Example:
- Input:
1 2 3and4 5 6 - Output:
32(14 + 25 + 3*6 = 4+10+18 = 32)
Sample Test Verification
3 Test CasesSample Input (stdin)
1 2 3 4 5 6
Expected Output (stdout)
32
solution.py
Pyodide v0.26.4 WASM
Initializing Monaco Python Environment...
Input (stdin)
1 2 3
4 5 6
Expected Output (stdout)
32