PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#Author : BlugonYT
#THE SPECIAL FUNCTION OF THIS CODE IS
#YOU CAN SET THE LENGTH OF THE PASSWORD THAT YOU GENERATE
import random
def check_input(num):
if num > 40: # you can change the maximum length here
print('The number is out of range')
else:
return num
inp = int(input("Enter the length of the password that you want to generate: "))
print("\nYour password is : ", end='')
[print(random.randint(1, 9), end="") for i in range(check_input(inp))]
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run