chrisCNG

guessing2

Feb 23rd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. # Password Generator
  2. # Choice
  3. from random import choice
  4. import string
  5.  
  6. output_str=""
  7. def makeChoices(len):
  8.     choice_str=""
  9.     for i in range(len):
  10.         chce = choice(string.ascii_letters + string.digits + string.punctuation)
  11.         choice_str=choice_str + chce
  12.     return(choice_str)
  13.    
  14. # Main***
  15. length=int(input("Password Length? "))
  16.  
  17. output_str=makeChoices(length)
  18. print("Your Password is: "+output_str)
  19. print("Cool!")
  20. #print(dir(string))
Add Comment
Please, Sign In to add comment