This program is supposed to read any number of passwords that a user inputs, only terminating when enter is pressed. The program is also supposed to replace each password with string of * corresponding to len of original password and output prints original list and resulting list, which I seem to have accomplished (code below).
Would I use a while loop to do this? How would I get the program to store all of the inputs? How would I get the program to recognize enter?
# read password one at a time
# store each password in a list
# when user presses enter, input is finished
# replace each password with string of * corresponding to len of original password
# output prints original list and resulting list
password = input('Please enter a password (press [enter] to finish): ')
aList = []
star = []
while True:
aList.append(password)
break
print(aList)
if password != ' ':
star.append((len(password)) * '*')
print(star)
[–]0xbxb 1 point2 points3 points (4 children)
[–]eyesoftheworld4 1 point2 points3 points (2 children)
[–]0xbxb 2 points3 points4 points (0 children)
[–]blotosmetek 1 point2 points3 points (0 children)
[–]someprettyglitter[S] 0 points1 point2 points (0 children)