'How can I use an "if statement" to check if what a user has inputted is the same as text on another file? (Python)

I am making something that is password protected and to stop you from being able to see the password just by looking at the code I put it on another file and I am trying to have the code check if what was input is the same as the password on the other file

I have a variable that reads the file with the password and a different variable that reads what the user input and when I make an if statement that checks if the user input variable is the same as what is on the other file but if I input the correct password to the variable that gets checked against the other file it doesnt say I put the right one in



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source