python query - function arguments are incorrect type?
<p>i'm pretty new to python and i'm having trouble with passing an argument into the random.choice function.</p>

<p>basically i'm trying to write a loop that will start off by selecting a random letter(which are all names of other lists) from the 'a' list, then input the selected letter into random.choice again to generate a sequence of random letters.</p>

<p>unfortunately the second call to random.choice isn't working, it just keeps repeating the inputted letter instead of pointing to a new list. any ideas how to fix this? i've been looking online for a few hours but can't find any similar problems/solutions. any help would be much appreciated!</p>

<pre><code>import random

a = ['b','c','d']
b = ['a','e']
c = ['a','d','f']
d = ['a','c','e','f','g','h']
e = ['b','d','h']
f = ['c','d','g','i']
g = ['d','f','i']
h = ['d','e','g','i']
i = ['f','h']

x = 0
answer = random.choice(f)
print "answer is %s " % answer

while x &lt; 5:
    answer2 = random.choice(answer) 
    print "answer2 is now %s " % answer2
    x = x + 1
</code></pre>
