Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def character_generator():
- list=["a","b","c","d","e","f","g","h","i","g","k","l","m","n","o","p","q","r","s","t","u","v",
- "w", "x", "y", "z","1","2","3","4","5","6","7","8","9","@","_","-","!"]
- myChoice=choice(list)
- for item in list[:26]:
- if myChoice==item:
- case_random=randint(0,1)
- if case_random==0:
- myChoice=myChoice.upper()
- else:
- myChoice=myChoice.lower()
- return myChoice
- def random_password(length):
- passW=""
- for i in range(length):
- passW=passW + character_generator()
- return passW
- passWord=random_password(int(input("what is the password length? >")))
- print("My passWord is : " + passWord)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement