Добрый день! Не могу понять почему у меня при указании числа 22 в количестве символоа кода,выходит всего один символ.Подскажите.
import random class PasswordGenerator: letters_alphabet="qwertyuiopasdfghjklzxcvbnm" digits_alphabet = "0123456789" specsymbols_alphabet = "!@#$%^&*(" def __init__(self, lenght=22, use_letters=True,use_digits=True, use_specsymbols=False): self.lenght = lenght self.use_letters=use_letters self.use_digits=use_digits self.use_specsymbols=use_specsymbols print(lenght, use_letters, use_digits, use_specsymbols) def generate_password(self): alphabet = "" if self.use_letters: alphabet += self.letters_alphabet if self.use_digits: alphabet += self.digits_alphabet if self.use_specsymbols: alphabet += self.specsymbols_alphabet if not alphabet: print("Empty alphabet") return password = "" for i in range (self.lenght): password+=random.choice(alphabet) return password generator1 = PasswordGenerator (use_specsymbols = True) print(generator1.generate_password()) print (generator1.generate_password()) generator2 = (PasswordGenerator(lenght = 22)) print(