Input datatype error
<p>I have a program which takes a string and converts it into list which looks like this -   <code>['CTTC', 'CGCT', 'TTTA', 'CATG']</code>. (its actually a lot longer than this). Now I need to find how many of these list elements have a <code>C or A or T or G</code> as its 1st letter. This needs to be taken from the terminal i.e. using the <code>input</code> function.</p>

<p>Now as far i know, in python 3.2 the datatype of input function is by default taken as a string (<code>str</code>) and not like an integer (<code>int</code>) (can be seen by using <code>isinstance</code>). However since I am using a college server, the python version is older (i think 2.7 or later but below 3.0). In this case, when I use the input function to ask the user to choose a letter-     <code>initial = input("Choose a letter:")</code>, and when I enter any letter (A,T,G,or C) it gives me an error <code>NameError: name 'C' is not defined</code>. When i checked the datatype using <code>isinstance</code>, i realized that the python version takes the datatype of input as an <code>int</code> . When i try to convert it into a string, it gives the same error. Is it the problem of the version or is it something i am doing wrong. My code is below.</p>

<pre><code>import sys
#import random

file = open(sys.argv[1], 'r')
string = ''
for line in file:
    if line.startswith("&gt;"):
        pass
    else:
        string = string + line.strip()


w = input("Please enter window size:")
test = [string[i:i+w] for i in range (0,len(string),w)]
#seq = input("Please enter the number of sequences you wish to read:")
#first = random.sample((test), seq)
print test
l = input("Enter letter for which you wish to find the probability:")
lin = str(l)
print lin
</code></pre>
