I have below code in python and I do not know why but it does not work as expected.
The value from variable isactive is qual to "True" and it is coming from a json dictionary. However, when I write down below if statement, the program is printing "Hola" out. Please see below code:
response = requests.request("GET", url, headers=headers, params=querystring)
variable = response.text
variable = json.loads(variable)
isactive = lista1[listanumber]['IsActive']
print isactive (ourput for this is giving me "True")
if isactive != "True":
print "hola"
However, above if-statement is printing "Hola" and I do not understand why since the isactive variable is equal to "True".
Do you know what may be the problem?
Thanks
Aucun commentaire:
Enregistrer un commentaire