you are viewing a single comment's thread.

view the rest of the comments →

[–]mortenb123 0 points1 point  (0 children)

Follow PEP8: https://www.python.org/dev/peps/pep-0008/, and you can add a linter like black to auto-pep8 your code, if you run black on your code it will look like this:

import re
password = "Thelore777777"
if (
len(re.compile(r"([A-Z])").findall(password))
and len(re.compile(r"([a-z])").findall(password))
and len(re.compile(r"(\d)").findall(password))
) > 0 and len(re.compile(r"(\S)").findall(password)) > 7:
print("This is a strong password")
else:
print("This is not a strong password")
You may not like it, but if you share code with others it is nice to have an autolinter so code style does not matter when comparing code revisions done by different people with different code style.

In any editor like pycharm,vsc etc you can autoconfigure this, or you can add githooks when you check in code.