How do I convert a list to an integer?
<p>This my code:</p>

<pre><code>snumA = random.sample([4,8,3], 1)
snumB = random.sample([7,2,6], 1)
snumC = random.sample([1,5,9], 1)

sgnA = random.choice(['+','-','/','*'])
sgnB = random.choice(['+','-','/','*'])
sgnC = random.choice(['+','-','/','*'])

if sgnA == '-' :
    sum1 = snumA - bnumA
    print 'minus'
if sgnA == '/' :
    sum1 = snumA / bnumA
    print 'divide'
</code></pre>

<p>Whenever I run this code I get an error message telling me that my operands are lists and not integers. I've looked everywhere and  I still don't know what to do. Could I have some help, please?</p>

<ol>
<li>As suggested before, use random.choice</li>
<li>bnumA is not defined. The code below assumes you meant snumB</li>
</ol>

<p>So the code you are looking for might be:</p>

<pre><code>import random

snumA = random.choice([4,8,3])
snumB = random.choice([7,2,6])
snumC = random.choice([1,5,9])

operators = {'+':'Plus', '-':'Minus', '/':'Division','*':'Multiplication'}
sgnA = random.choice(list(operators.keys()))
sgnB = random.choice(list(operators.keys()))
sgnC = random.choice(list(operators.keys()))

print(eval(str(snumA)+sgnA+str(snumB)))
print(operators[sgnA])
</code></pre>

python