擅长:python、mysql、java
<p>您的变量“question”是一个整数,您可能在代码的更高层做了一些错误的事情。你知道吗</p>
<p>编辑:</p>
<pre><code>question = random.randint(1,30)
</code></pre>
<p>question是整数类型,所以不能使用.configuration()方法。
如果您想随机选择一个问题,可以声明一个列表并使用<code>random.choice</code>方法</p>
<pre><code>questions_list = [
"my_first_question",
"my_second_question",
"ect..."
]
random.choice(questions_list)
</code></pre>