just add strip to remove unwanted space/newline characters
import sys
print("enter your password")
pword = (sys.stdin.readline())
if pword.strip() == "hi":
print("i rule")
else:
print("sucker")
0
solved python if variable == string wont work when you enter correct value [closed]