"input": "def shuffle(*args):\n combinations = [[i] for i in args[0]]\n for arg in args[1:]:\n tempcomb = []\n for i in arg:\n print i\n tempcomb += [c+[i] for c in combinations if i not in c ]\n combinations = tempcomb\n return combinations\nshuffle(a,b,c)",
"input": "def array_combinations(*args):\n combinations = [[i] for i in set(args[0])]\n for arg in args[1:]:\n tempcomb = []\n for i in set(arg):\n tempcomb += [c+[i] for c in combinations if i not in c ]\n combinations = tempcomb\n return combinations\nres = array_combinations(a,b)\nprint res\nprint len(res)",
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": "4\n5\n6\n7\n8\n9\n7\n"
"text": "[[4, 3], [3, 7], [4, 7]]\n3\n"
}
],
"prompt_number": 50
"prompt_number": 115
},
{
"cell_type": "code",
"collapsed": false,
"input": "x= [2,4,3]\nx + 6",
"input": "",
"language": "python",
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "can only concatenate list (not \"int\") to list",