Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def weak():
- weak_lower1=''
- for alp in range(1,6):
- lower=random.choice("abcdefghijklmnopqrstuvwxyz")
- weak_lower1=weak_lower1+lower
- caps=random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
- numericals=random.randint(1,100)
- special=random.choice("!@#$%")
- weak_password=caps+weak_lower1+str(numericals)+str(special)
- return weak_password
- def strong():
- strong=''
- for alp in range(1,11):
- lower=random.choice("abcdefghijklmnopqrstuvwxyz")
- strong=strong+lower
- caps=random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
- numeri=''
- for num in range(0,5):
- numericals=random.randint(1,100)
- numeri=numeri+str(numericals)
- special_1=''
- for number1 in range(0,4):
- special=random.choice("!@#$%")
- special_1=special_1+special
- strong_password=caps+strong+numeri+special_1
- return strong_password
- print("Hello. Welcome to Niraja's free password generator")
- user=input("Please enter if you would require a weak or strong password")
- if user==("weak" or "Weak" or "WEAK"):
- print("Your weak password is : {}".format(weak()))
- elif user==("strong" or "Strong" or "STRONG"):
- print("Your strong password is :{}".format(strong()))
- else:
- print("You have entered wrong input. Please try again")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement