擅长:python、mysql、java
<p><code>a</code>是一个列表,<code>re.compile()</code>需要一个字符串。变量名<code>i</code>通常只用于整数,例如<code>ch</code>用于字符(如果要使用短变量名,则应遵守惯例:-)</p>
<p>也许是这样的:</p>
<pre><code>usertext = raw_input("Enter string of length 7 to generate your scrabble helper: ")
lst = []
for ch in usertext:
lst.append(ch)
print(lst)
scrabble_re = re.compile(''.join(lst))
</code></pre>
<p>或者是同等的,但要短得多:</p>
^{pr2}$
<p>是吗?在</p>