Separate list into two equal parts with slices
<p>I need to write a function that splits any list into two equal parts. If length of list is even, I want just split it it two parts, and if length of the list is odd, I want to ignore central element.</p>

<pre><code>So [1,2,3,4,5,6] =&gt; [1,2,3] and [4,5,6]
and [1,2,3,4,5] =&gt; [1,2] and [4,5]
</code></pre>

<p>I tried to do the following way:</p>

<pre><code>list = [1,100,50,-51,1,1]
s = len(list)/2
left = list[s+1:]
right = list[:s]
</code></pre>

<p>But this approach doesnt work both for even and odd lengths. 
Is there a way to use slices for this purpose or there is no way and it's better to use loops/iterations?</p>

<p>Try this</p>

<pre><code>length = len(list)
half = int(length/2)
first_half = list[:half]
second_half = list[length-half:]
</code></pre>

<p>The trick here is cutting the decimal off of half when it's odd</p>

python