Home > Blockchain >  Why are these two strings not equal in Python?
Why are these two strings not equal in Python?

Time:06-27

I have a simple python code sample

import json
hello = json.dumps("hello")
print(type(hello))

if hello == "hello":
    print("They are equal")
else:
    print("They are not equal")

This is evaluating to "They are not equal". I don't understand why these values are not equal.

I'm re-familiarizing myself with Python but I read that this "==" can be used as an enter image description here

  • Related