Sep-21-2019, 05:13 AM
Documentation from python.org:
built-in function zip(),
string method str.join(),
conditional expressions,
generator expression
Python is so concise that expressing it in spoken language is much longer and complicated:
"generate character if character is equal to guess else generate star for every character - star pair in zipped password and display",
"join generated chars and stars into string"
Assign value of newly generated string to display (required if one want to repeat the operation)
built-in function zip(),
string method str.join(),
conditional expressions,
generator expression
Python is so concise that expressing it in spoken language is much longer and complicated:
(char if char == guess else star for char, star in zip(password, display))
"generate character if character is equal to guess else generate star for every character - star pair in zipped password and display",
''.join
"join generated chars and stars into string"
display =
Assign value of newly generated string to display (required if one want to repeat the operation)
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.