#Uses python3 import sys def max_dot_product(a,b,n): a = a.sort(reverse=True) b = b.sort(reverse=True) res = 0 for i in range(n): res +=
sort sorts a list in place and (implicitly) returns None. Drop the assignment of the return value and you should be OK:
sort
None
a.sort(reverse=True) b.sort(reverse=True)