PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# created by walter on 5 Feb,2024
class Validation:
def __init__(self,passwordInput:str) -> None: # returns nothing
"""Initializing the validation"""
self.numbers_list: list = "0 1 2 3 4 5 6 7 8 9".split(
" "
) # splits the characters with space and stores the characters in a list
self.special_list: list = "! @ # $ % & * ".split(
" "
) # this is like above [SPACE IS SUPPORTED]
self.input_password: str = passwordInput
self.password_length: int = len(
self.input_password
) # calculating the string length
def passwordValidator(self) -> str: # returns string
if self.password_length > 7:
number_counter: int = 0 # number characters count
special_counter: int = 0 # special characters count
for num in self.numbers_list:
for i in range(self.password_length):
if self.input_password[i] == num:
number_counter += 1
if number_counter >= 2:
break
for char in self.special_list:
Enter to Rename, Shift+Enter to Preview
OUTPUT
Запуск