I have a password. It contains newline (lets for now omit why) character and is: "h2sdf\ndfGd" This password is in dict my_dict. When I just print values of dict I get "\" instead of "" - "h2sdf\ndfGd"! Don't understand why. When I get it and use it to authenticate to web server, it says that Authentication fails. When I try to compare:
my_dict["password"] == "h2sdf\ndfGd"
it returns False.
But when I try just print(my_dict["password"]) I get h2sdf\ndfGd which is identical, but for python it is not. Why? I am lost.
source https://stackoverflow.com/questions/71608042/python-equal-strings-are-not-equal-with-new-line-character-in-it
Comments
Post a Comment