Execute Statement in Python error Name Not Defined : <p>I am trying to use a Python list comprehension to get the Variable Name SW1 to equal the string "sw1" but I keep getting an error saying sw1 not defined</p>

<pre><code>    VarList = ["SW1"]
    VarListEnd = ["sw1"]

    list3 = [exec("%s="%x + "%s"%y) for x in VarList for y in VarListEnd]
    list3
</code></pre>

<p>How do I amend the exec statement because that is where I think the error is? 
Really appreciate your help. Thanks in advance.</p>
