password_v.set(password): Assign the concatenated password to the declared string variable.password=”Created password: “+str(password): Concatenate the string with a text.password_v = StringVar(): Declare a string variable to substitute the text in the entry widget.Hence join is used to convert the list to string using ” (no space or empty). Password = ”.join(password): Both the random functions return a list.This is due to the difference in ASCII values A password made with sample may contain similar letters of uppercase and lowercase. Both functions of random take the string to obtain a substring of and k = length, mentioning the length of the substring. If repeat=1, then use sample for unique characters without repetition and choice if repetition is allowed.
0 Comments
Leave a Reply. |