I have searched and searched and tried everything. I am creating a game where the user will input a pre-assigned pin and I want to validate that pin against a .txt file in Python. I have tried so many different lines of code and my result is either everything is valid or nothing is valid. What am I doing wrong? The pins are formatted on each line and are alpha numeric like this...
1DJv3Awv5
1DGw2Eql8
3JGl1Hyt7
2FHs4Etz4
3GDn9Buf8
1CEa9Aty0
2AIt9Dxz9
5DFu0Ati4
3AJu9Byi4
1EAm0Cfn1
3BEr0Gwk0
7JAf8Csf8
4HFu0Dlf4
Here is what I have:
user_input = input('Please enter your PIN: ')
if user_input in open("PINs.txt").read():
print('Congratulations! Click the button below to get your Bingo Number.')
else:
print('The PIN you entered does not match our records. Please check your PIN and try again.')