defining a function without using ":"
<p>I have been asked to define a function which is called <code>avg</code>. <code>avg</code> should calculate the average of two lists with the same amount of numbers - take all the numbers from both lists and calculate their average.<br>
However, it is not allowed to use <code>:</code> nor more than one line (except <code>import</code> lines).</p>

<p>My closest try was:</p>

<pre><code>//import line does not count as a line
import numpy
//the code line (only one is allowed)
avg=lambda lst1,lst2: numpy.mean(lst1+lst2)
</code></pre>

<p>My function properly calculates the average of the lists but it contains <code>:</code>, so it is not good enough.    </p>

<p>Speaking of ridiculous, I suggest:</p>

<pre><code>&gt;&gt;&gt; exec(''.join(map(chr, [100, 101, 102, 32, 97, 118, 103, 40, 108, 115, 116, 49, 44, 32, 108, 115, 116, 50, 41, 58, 32, 114, 101,116, 117, 114, 110, 32, 48, 46, 53, 32, 42, 32, 115, 117, 109, 40, 108, 115, 116, 49, 32, 43, 32, 108, 115, 116, 50, 41, 32, 47, 32, 108, 101, 110, 40, 108, 115, 116, 49, 41])))
&gt;&gt;&gt;
&gt;&gt;&gt; avg([1,2,3,4],[5,6,7,8])
4.5
</code></pre>

python