What you have is a list of lists, aka a matrix. You are trying to strip each list using a for-loop, and you can't really strip a list.
You have to enumerate through each item in each row, THEN strip that item.
What you were trying to strip before was:
['46', 'Celsius'] # A list
Instead of:
'Celsius' # A string
The code is rewritten below:
lines = []
with open('file/location') as f:
lines = f.readlines()
# Enumerates through each list/row in the matrix.
for row in range(len(lines)):
# Enumerates through each item in that list
for column in range(len(row)):
# Strip each item using its row and column number.
lines[row][column] = lines[row][column].strip()
print(lines)
Result:
[['46', 'Celsius'], ['42', 'Celsius'], ['93', 'Fahrenheit']]