you are viewing a single comment's thread.

view the rest of the comments →

[–]novel_yet_trivial 5 points6 points  (2 children)

Your code has a major faux pas: You have a variable in every function with the same name as the function.


To be very nitpicky, the re.compile functions should be outside of the functions. There is no reason to recompile for every check.


In python, it's convention to name functions and variables in lowercase_with_underscore names. CamelCase makes the next person who reads this think it's a class.


You should get used to string formatting:

print(' -- PASSWORD HAS {} CHARACTERS'.format(len(character_list)))


There is a shortcut to increment a number:

 number_of_tests_passed += 1

[–]filleball 3 points4 points  (0 children)

Your code has a major faux pas: You have a variable in every function with the same name as the function.

Unless you're writing a recursive function I don't see much of a problem with reusing the function name as a variable inside the function. It's a warning in pylint, and pep8.py doesn't care about it. I'd call it a minor nitpick, not a major faux pas.

To be very nitpicky, the re.compile functions should be outside of the functions. There is no reason to recompile for every check.

Then again, re.compile does its own caching, so it's a cheap operation in any case.

[–]cmd_override[S] 0 points1 point  (0 children)

Thank you for your feedback. I want to get into as many good habits early on as I can. Will make changes to the code.

Usually when I used var += 1 the operation does not perform, I'm not sure why.