Question

IN PYTHON Write a program that generates a password that is composed of your ID and...

IN PYTHON

Write a program that generates a password that is composed of your ID and Full Name after being scrambled and ignoring any spaces.

Example: If your ID is 123 and your full name is “John Doe” then the password might be “J1eon3hD2o”.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the python program which generates the scrambled password and added necessary comments in it.

Program:

import random
#read user input
ide=input("Enter your Id: ")
name=input("Enter your name: ")

#remove spaces from name and ide
name=name.replace(" ", "")
ide=ide.replace(" ", "")

#concatenate both name and ide
catPasswd=name+ide

#scramble the generated password
scramblestring=''.join(random.sample(catPasswd,len(catPasswd)))
print(scramblestring)

Output:

Enter your Id: 123
Enter your name: Lenbron James
ornmbJ3sa2e1eL

Screen Shot:

Add a comment
Know the answer?
Add Answer to:
IN PYTHON Write a program that generates a password that is composed of your ID and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT