Now back to the point, now we have created a “store” variable that will contain the characters of the password. IT IS USED TO GET TO KNOW ABOUT WHAT EXACTLY A FUNCTION IS DOING. NOTE: YOU CAN GIVE A DOCSTRING OF YOUR FUNCTION BY WRITING THEM BETWEEN THREE QUOTATIONS MARKS ON BOTH SIDES. Word = "".join(store) #Making the password a stringĪs said above, we have made a function named password(), and then below we have written docstring of this function. Random.shuffle(store)# Shuffling it again Punct = random.choice(string.punctuation) Small = random.choice(string.ascii_lowercase) def password(): #creating a password generating functionįor i in range(char_length):# using string module to generate the passwordĬap = random.choice(string.ascii_uppercase) Since both these modules come built-in in python, so we don’t need to download anyįirst, we are going to import the modules.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |