-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday6.py
More file actions
20 lines (15 loc) · 1 KB
/
day6.py
File metadata and controls
20 lines (15 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Things I learned is about modules and functions, go through three different ways of importing functions first one is directly import function_name second if exist in any another folder not in same where you writing code then folder_name.functions and last one if module exist somewhere else only, then use sys.path.append('path'). Go through different modules like math / calendar etc.
# 🎯 Challenge
# - Generate a random 8-character password
import string, random
def generate_password(password_length):
character_choice = string.ascii_letters +string.digits +string.punctuation
password=""
for i in range(password_length):
password += "".join( random.choice(character_choice))
return password
number_of_unique_password = int(input('How many unique password you want = '))
for i in range(1,number_of_unique_password+1):
user_input = int(input(f'Kindly enter the length of password {i} you want = '))
password = generate_password(user_input)
print(password)