Feb-15-2020, 11:10 PM
(Feb-15-2020, 08:13 PM)renveg Wrote: My question is, how does the program know that I want the key returned from the variable account? How could I use the key and return the value?
if you enter in the command line
python password.py email
, the 'account' variable (line #11) will be set to
email
(a string). Further, the program checks if the record named 'email' exists in PASSWORD dictionary and tries to get corresponding password for the account (email): PASSWORD[account]
. pyperclip.copy
is copying the value of password (in case of 'email' account it would be 'incospmei#$%') to clipboard. Finally, you get information that password was copied (line #15). Hope that helps.