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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!