d_skat

sem7_4

Apr 23rd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. from itertools import *
  2. def transpose(matrix):
  3.     return zip(*matrix)
  4.  
  5. def uniq(lists):
  6.     return [x for x in{y for y in lists}]
  7.  
  8.  
  9. def dict_merge(*x):
  10.     return dict(chain.from_iterable(sym.items() for sym in x))
  11.  
  12. def product(vec_1, vec_2):
  13.     product = 0
  14.     for a, b in zip(vec_1, vec_2):
  15.         product += a * b
  16.     return product
Advertisement
Add Comment
Please, Sign In to add comment