I have this txt file:
TP 0.8329
And i tried to extract that float after "TP" using the following code:
def definir_operacao():
end = 0
oper = []
for x in range(len(lines[0])):
if(lines[0][x] == " "):
end += 1
elif(end == 1):
oper.append(int(lines[0][x]))
str2 = ''.join(oper)
return str2
ci = definir_operacao()
print(ci)
But i get a empty variable as response, so i guess i'm making something wrong, can anyone help me?