NameError: name 'A' is not defined
<p>QUESTION:
Write a program that takes a position on a chess board as a column col and row value row and checks whether or not the position is valid. Remember that the column in a chess board is a letter ranging from A to H (inclusive) and the row is a number between 1 and 8 (inclusive). A3 or E7 are valid inputs but a1 or L5 are not. If both coordinates are valid, such as E2, the programs prints 'The piece is moved to E2.', otherwise it prints 'The position is not valid.'.</p>

<p>MY ANSWER:</p>

<pre><code>a=raw_input("you move to:")
col = [A, B, C, D, E, F, G]
row = [1, 2, 3, 4, 5, 6, 7]
if (a in col) and (a in row):
 print 'The piece is moved to '%s%d   %input
else:
 print 'The position is not valid.'
</code></pre>

<p>ERROR (after plugging in a value like D5)</p>

<pre><code>Traceback (most recent call last):
  File "&lt;web session&gt;", line 2, in &lt;module&gt;
NameError: name 'A' is not defined
</code></pre>

<p>REQUEST:</p>

<p>Can you direct my on how to fix my program?</p>

<p>CONTEXT:</p>

<p>The purpose of this task is to set me up to answer the following QUESTION:</p>

<p>So far, your program used two separate inputs: a column and a row value. Can you modify your previous program (chess problem, version 3) to accept the position on the chess board as a single input. In other words, assume that there is a variable position which stores both the column and the row value of a chess board such as B5. When both the coordinates in the input are valid, for example, c4, the program prints the message The piece is moved to c4.. If the first coordinate is out of range, print The first coordinate is not in the range a-h or A-H!, if the second coordinate is out range, print The second coordinate is not in the range 1 to 8!.</p>

<p>CLOSE:</p>

<p>Thank you for your assistance.</p>
