
import random
import itertools

givers = [('tim', 'shirt'), ('jim', 'shoe'), ('john', 'ball'), ('joe', 'fruit')]

if len(givers) < 2:
    print "must have more than 1 givers"
else:    
    a = list(givers)
    b = list(givers)

    while a == b:
        random.shuffle(a)
        random.shuffle(b)

    for i, j in itertools.izip(a, b):
        print '%s gives %s to %s.' % (i[0], i[1], j[0])

@@ -26,16 +26,139 @@
 rtools%0A%0A
+def valid(a, b):%0A%0A    for i, j in itertools.izip(a, b):%0A        if i%5B0%5D == j%5B0%5D:%0A            return False%0A    return True%0A%0A
 givers =
@@ -359,14 +359,23 @@
 ile 
-a ==
+not valid(a,
  b
+)
 :%0A  

add in valid() function