Jun-02-2020, 12:14 AM
When you use
But when you iterate over the opened file object, newlines are not removed, and you're not doing that in the code. So the string read from the file will never be equal to the input string.
Also, consider using string.ascii_lowercase and string.ascii_letters + string.digits instead of the hardcoded lists of letters.
input()
note that it does not include a trailing newline. inputBut when you iterate over the opened file object, newlines are not removed, and you're not doing that in the code. So the string read from the file will never be equal to the input string.
rstrip()
would be useful here.Also, consider using string.ascii_lowercase and string.ascii_letters + string.digits instead of the hardcoded lists of letters.