Turning a list into a set - Python
<p>I wanted to print a set of lines in a file that start with a certain character (here it's "c"), but I get an error whenever I try to convert a list into a set</p>

<p>I have the following code:</p>

<pre><code>z = open("test.txt", "r")
wordList = [line.rstrip().split() for line in z if line.startswith(("c"))]
wordList = set(wordList)
print(wordList)
</code></pre>

<p>Here is the error I get:</p>

<pre><code>Traceback (most recent call last):
   wordList = set(wordList)
TypeError: unhashable type: 'list'
</code></pre>