Write an automated password-hiding program that
could be used in automatic password manager. The program will first
read user
passwords, one at a time, and store them in a list. When the user
enters an empty
string (just hits enter), they are finished with the input. The
program should
then replace each password with a string of * corresponding to the
length of the
original password. As the output, the program should print the
original list and
the resulting list.
For instance, here’s the output from a sample run of your
program:
Please enter a password (press [enter] to finish):
Compsc123
Please enter a password (press [enter] to finish): Teams
Please enter a password (press [enter] to finish): ABCABC
Please enter a password (press [enter] to finish):
[’Compsc123’, ’Teams’, ’ABCABC’]
[’*********’, ’*****’, ’******’]
PYTHON PLEASE! THANK YOU
lst = [] while True: p = input("Please enter a password (press [enter] to finish): ") if p == '': break lst.append(p) print(lst) for i in range(len(lst)): lst[i] = '*' * len(lst[i]) print(lst)
Get Answers For Free
Most questions answered within 1 hours.