dimanche 21 juillet 2019

Check if "word" is in string outputted from a function

I have a function in variable x which returns

{'activeTime': 106, 'deviceStatus': 'on', 'power': 'f29b:f19e', 'energy': 0.02, 'voltage': '7b2ba:7b366', 'deviceImg': ''}

so then I put

if 'on' in x:
    print('on')

but it doesnt print on, what am i missing?

Aucun commentaire:

Enregistrer un commentaire