Shuffling and attaining class objects in Python
<p>I have a class called allTheQuestions:</p>

<pre><code>answers = ['def', 'break', 'len(string)']
    q1options = ['func', 'def', 'function', 'define'];
    q2options = ['break', 'loop out', 'stop', 'abandon'];
    q3options = ['string.length', 'str(length)', 'len(string)', 'len.string'];
    q1 = raw_input('What is the keyword for functions in Python? ');
    q2 = raw_input('What keyword terminates a loop in Python? ');
    q3 = raw_input('How do you get the length of a string? ');
    questionList = [q1, q2, q3]
    questionShuffled = random.shuffle(questionList)
</code></pre>

<p>I have a function called questions:</p>

<pre><code>def questions():
    score = 0
    print(allTheQuestions.questionShuffled)
    q1answer = allTheQuestions.q1options[1];
    print(q1answer)
</code></pre>

<p>I want the function to shuffle my question list and then print them out in a random order. so far I can comment out this line <code>print(allTheQuestions.questionShuffled)</code> and it will run the questions in the order they are in the class. how can I do this so that it will randomize them in different orders?</p>

<p>thanks</p>