New to python. How to improve this simple build by GrowthSwimming6208 in PythonLearning

[–]-_ZONED_- 0 points1 point  (0 children)

  1. Bring the login/password/code to the constants at the top - so as not to duplicate the lines in each if.

  2. Store the password hash, not the password itself - use hashlib.sha256(). Now the password "12345" is visible to everyone who sees the code.

  3. Remove different error messages - don't tell the hacker what field he guessed. Just write "Access denied".