diff options
Diffstat (limited to 'challenge-145/lubos-kolouch/python/ch-1.py')
| -rw-r--r-- | challenge-145/lubos-kolouch/python/ch-1.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/challenge-145/lubos-kolouch/python/ch-1.py b/challenge-145/lubos-kolouch/python/ch-1.py new file mode 100644 index 0000000000..bcd2e57de6 --- /dev/null +++ b/challenge-145/lubos-kolouch/python/ch-1.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + + +def dot_product(a, b): + return sum(x * y for x, y in zip(a, b)) + + +a = [1, 2, 3] +b = [4, 5, 6] +print(dot_product(a, b)) # Output: 32 |
