Question
It says my program has no output, can you help me figure out why and how to fix it? SCENARIO: Many user-created passwords are simple
It says my program has no output, can you help me figure out why and how to fix it?
SCENARIO:
Many user-created passwords are simple and easy to guess. Have a program that takes a simple password and makes it stronger by replacing characters using the key below, and by appending "q*s" to the end of the input string.
- i becomes !
- a becomes @
- m becomes M
- B becomes 8
- o becomes .
Ex: If the input is:
mypassword
the output is:
Myp@ssw.rdq*s
Hint: Python strings are immutable, but support string concatenation. Store and build the stronger password in the givenpasswordvariable.
MY CODE:
word = input()
password = ''
for x in word:
if (x=='i'):
password+='!'
elif(x=='a'):
password +='@'
elif(x=='m'):
password +='M'
elif (x=='B'):
password+='8'
elif (x=='o'):
password+='.'
else:
password +='x'
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started