Password validation (using Python)

preview_player
Показать описание
Writing a program in Python that checks whether a password is valid (follows the criteria) or not.
#python #pythonforbeginners #pythontutorial #tutorial
Рекомендации по теме
Комментарии
Автор

Awesome work! I think one suggestion would be to think of how you can simplify your code if you were to do only one pass over the characters of the password and were to change the space complexity to O(1).

RonazFarahmand
Автор

the part which tests for not allowed can be optimized. it currently runs in O(nk) where k = length of not allowed, since the in operation takes linear time. change not_allowed to be a set and instead of iterating through that, iterate through n and check if the current char is in not_allowed. since set look up time is O(1) it reduces the time complexity to O(n).

also, this is thorough which is good, but it's best practice to break this up into separate functions and smash them all together using an and in the main function.

hidude
Автор

a lot of conditions on my password!!!😃😁

NexusCoDm
visit shbcf.ru