Make python read 12 from file as 12 not 1 and 2
<p>Trying to make a program that provides the price to different numbers of stages. In "tripss.txt",third line is the number 12, python interprets it as 1 and 2 instead and gives the price for each rather than the number as a whole, any way to fix it to that it's read as 12?.</p>

<pre><code>infile = open("tripss.txt","r")  
customer_one= infile.readline().strip("\n")     
customer_two= infile.readline().strip("\n")  
customer_three= infile.readline().strip("\n")      
one_to_three_stages="euro 1.55"   
four_to_seven_stages="euro 1.85"   
seven_to_eleven_stages="euro 2.45"  
more_than_eleven_stages="euro 2.85"  
cheapest = ["1","2","3"]       
cheap = ["4","5","6","7"]    
expensive = ["7","8","9","10","11"]     
    for number in customer_three:     
    if number in cheapest:   
        print one_to_three_stages    
    elif number in cheap:     
        print four_to_seven_stages    
    elif number in expensive:    
        print seven_to_eleven_stages   
    else:         
        print more_than_eleven_stages      
</code></pre>

<p>In your code it seems that you want to consider customer_three as a list of strings. However in your code it is a string, not a list of strings, and so the for loop iterates on the characters of the string ("1" and "2").<br>
So I suggest you to replace:  </p>

<pre><code>customer_three= infile.readline().strip("\n")  
</code></pre>

<p>with:  </p>

<pre><code>customer_three= infile.readline().strip("\n").split()
</code></pre>

python file for-loop numbers readlines