If I have a password, "rusty", and I input the sequence: "rusty123", "Rusty" and "rush" (which in turn is saved to a list newList), when I print out newList, how do I display a result that says:
rusty123, wrong by 3 characters
Rusty, wrong by 1 characters
rush, wrong by 2 characters
?
What I need to add is a function like (countDifference) that allows me to compare the right password 'rusty' with wrong passwords entered. So if I enter 'rusty123', it should compare 'rusty' to 'rusty123' and save the result as a integer (3 - because the password is off by 3 characters i.e. 123 is wrong). I then convert this integer to a string and record it to the file newFile.
I think something that takes (password ='rusty') as a constant, and then reads every line of a new password input, and compares it so 'rusty' will do the trick, but I just don't know how.
password = "rusty"
user_input = raw_input("Please enter the password")
so the user inputs: "Rusty" and the function reads that the password is wrong by 1 character, namely "R" - (should have been lower case)
SOLVED: If you have the same problem, follow the link that @Chris Beck provides at the end of his explanation. It solved this problem perfectly.