TypeError: string indices must be integers
Posted: Sat Jun 19, 2021 4:50 pm
So I have this bit of code that finds waveHeight and stores it as a cache, but when it reaches this section -
It just gives me this error -
I am in a bit of a hurry so if there is any more information you need then just ask, and I should respond soon!
Code: Select all
sorted (data, key = lambda i: i['hours']) #sorts through cache_file data
print([0])
if 'waveHeight' in [0] and 'dwd' in [0]['waveHeight'] and[0]['waveHeight']['dwd'] >= 2.00: #if date and waveHeight found <2.00 then print
print('Found')
It just gives me this error -
Code: Select all
sorted (data, key = lambda i: i['hours']) #sorts through cache_file data
TypeError: string indices must be integers
I am in a bit of a hurry so if there is any more information you need then just ask, and I should respond soon!