Write a program to generate passwords. The program should ask the user for a phrase and number, and then create the password based on our special algorithm. The algorithm to create the password is as follows:
If the users input word is less than 8 characters, output Password not long enough.
If the users input word is greater than or equal to 8 characters, do the following:
Replace es with @
Replace s or S with $
Replace t or T with +
Capitalize the word and add the number to the end.
Sample Run
Enter your word: zebras
Enter a number: 62
Password not long enough.
Enter your word: newyorkcity
Enter a number: 892
Password: N@wyorkci+y892
1
Expert's answer
2019-10-24T00:57:23-0400
Dear yousif, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order
Learn more about our help with Assignments: Python
Comments
Student1
26.03.20, 14:58
The code to Edhesive 7.2 Code Practice question 2 word = input("Enter
a word: ") number = input ("Enter a number: ") if (len(word) < 8):
print ("Password not long enough.") else: word = word.replace("e","@")
word = word.replace("s","$") word = word.replace("S","$") word =
word.replace("t","+") word = word.replace("T","+") word =
word.capitalize() print ("Password: " + word + number)
Leave a comment
Thank you! Your comments have been successfully added. However, they need to be checked by the moderator before being published.
Comments
The code to Edhesive 7.2 Code Practice question 2 word = input("Enter a word: ") number = input ("Enter a number: ") if (len(word) < 8): print ("Password not long enough.") else: word = word.replace("e","@") word = word.replace("s","$") word = word.replace("S","$") word = word.replace("t","+") word = word.replace("T","+") word = word.capitalize() print ("Password: " + word + number)
Leave a comment