Hello,
I have problem with arithmetic in python when use it like this code
#!/usr/bin/python
AA = open("a.txt").readline()
print AA
BB = 100
print BB + AA
Appear to me this error :
Traceback (most recent call last):
File "aa.py", line 6, in ?
print BB + AA
TypeError: unsupported operand type(s) for +: 'int' and 'str'
when delete the arithmetic line "print BB + AA" or change it to "print BB + 50"
the code working good
20
150
Why not confess with number when i get it from file ?
And the same error if I get the number from another python file like modul :
import file
print BB + file.number
any idea ?
Thanks