i have a text file with following data: deric, robert, mathew,
Now, i want the user to input a string and then compare that string with the text file..
fo = open("d:\\ar.txt", "r")
file_contents = fo.read()
print('Enter your password.')
typedPassword = input()
for i in file_contents:
if typedPassword == file_contents:
print('Access granted')
else:
print('Access denied')
However, this doesn't seem to work. any thoughts?