Q:

Text file number to Python number how?

I have a problem with the fact that when I open a file and import a line with command f.readline ().I run the module then It works good. It shows the number 600 or it doesn't matter what number it is. But how I can get that number to be used in further calculations? When I type the next calculation command, it says something like for command int it should be a string or a number. But how I turn that text file number to number that I can calculate with and Python understands? 
from math import *

with open('C:\\Users\\admin\\Desktop\\terehommik.txt', 'r') as f:
    for line in f:
        s = f.readline()

and from that line comes the number, and now i need to convert string number to real number
so i could after calculate with bank rate

A:

Use the int function:
x = int('600')

# x is now 600, can be used in computations
print x + 1  # No TypeError--prints 601

So,
s = f.readline()
x = int(s)
y = x * 5  # etc.

ADDENDUM:
OP, does your input file contain one number per line?  That's what I'll assume for now.
with open('myfile') as f:
    for line in f:
        x = int(line)
        print x+3

If the contents of myfile are:
600
3
67
987

then the above code will work, printing:
603
6
70
990

N.B., for floats, use the aptly named float function instead.

