A
A
Anton Chernyshev2020-06-12 14:54:16
Python
Anton Chernyshev, 2020-06-12 14:54:16

Importing the random module and using the attributes gives something like the following error: module 'random' has no attribute 'randit'. What is it connected with?

If needed, here is the code:
import random
letters = 'qwertyuiopasdfghjklzxcvbnm'
signs = '[email protected];:'
a = True
while a == True:
mod = input('''enter the number 1 to generate a password
, enter the number 2 to stop the program
''')
if mod == '2':
a == False
elif mod == '1':
pasword = ''
password_len = random.randint(8, 16)
for i in range(password_len):
variant = random.randint(1,3)
if variant == 1:
number = random.random()
password.append(number)
elif variant == 2:
letter = letters[random.randit(1, letters.len)]
letters_variant =random.randint(1, 2)
if letters_variant== 1:
letter = letter.upper()
password.uppend(letter)
else:
sign = signs[ random.randit(1, signs.len)]
password.uppend(sign)
print(password)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-06-12
@anton206060

randi n t

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question