Advertisement
Guest User

Untitled

a guest
Mar 15th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. import random
  2. def weak():
  3. weak_lower1=''
  4. for alp in range(1,6):
  5.  
  6. lower=random.choice("abcdefghijklmnopqrstuvwxyz")
  7.  
  8. weak_lower1=weak_lower1+lower
  9.  
  10. caps=random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
  11. numericals=random.randint(1,100)
  12. special=random.choice("!@#$%")
  13. weak_password=caps+weak_lower1+str(numericals)+str(special)
  14. return weak_password
  15.  
  16. def strong():
  17. strong=''
  18. for alp in range(1,11):
  19. lower=random.choice("abcdefghijklmnopqrstuvwxyz")
  20. strong=strong+lower
  21. caps=random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
  22. numeri=''
  23. for num in range(0,5):
  24. numericals=random.randint(1,100)
  25. numeri=numeri+str(numericals)
  26.  
  27. special_1=''
  28. for number1 in range(0,4):
  29. special=random.choice("!@#$%")
  30. special_1=special_1+special
  31. strong_password=caps+strong+numeri+special_1
  32. return strong_password
  33.  
  34. print("Hello. Welcome to Niraja's free password generator")
  35. user=input("Please enter if you would require a weak or strong password")
  36. if user==("weak" or "Weak" or "WEAK"):
  37. print("Your weak password is : {}".format(weak()))
  38.  
  39. elif user==("strong" or "Strong" or "STRONG"):
  40. print("Your strong password is :{}".format(strong()))
  41.  
  42. else:
  43. print("You have entered wrong input. Please try again")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement