Please use python to program this question! User ID and Password Generator You have written an award winning video game

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Please use python to program this question! User ID and Password Generator You have written an award winning video game

Post by answerhappygod »

Please use python to program this question!
User ID and Password Generator
You have written an award winning video game called <insert a
cool name for your game here>. You have finished
coding the game and now all that is left is to write a program that
will generate a fun user ID and a secure password for new
players. (This is the only part that you will do for
this assignment -- you will assume that the game is complete and
you're about to make millions of dollars from it).
Your program will generate a user ID from two lists of words --
one being a list of adjectives and the other being a list of
animals. You will read these two lists from a website, much
like you did for the last assignment where you read the list of 5
letter words. Reuse your code for reading from a website to
read both of the lists (one at a time). Make sure that the
user receives a reasonable message if something goes wrong when
trying to read the website. Remember to import
urllib.request.
Store each in a list of strings, one representing the adjectives
and one representing the animals. You must not have two
readFile() functions -- only one!
The two files to use are as follows:
adjectives: https://tinyurl.com/ywy6f72e
animals: https://research.cs.queensu.ca/home/cords2/animals.txt
Next write a function that will take the two lists and chose one
adjective and one animal at random and return the user ID.
So, for example, you may choose "intelligent" from the adjectives
list and "baboon" from the animals list so the user ID will be
IntelligentBaboon. You must capitalize the first letter of
each of the words.
Next, you will write a function that will generate a password
for the user with the following properties:
1) there must be at least one capital letter (but there may be
more)
2) there must be at least two lower case letters (but there may
be more)
3) there must be at least one number that is greater than or
equal to 5 and one number that is less than 5 (maybe
more)
4) there must be at least one punctuation mark (you can get a
string containing all punctuation marks by importing the string
module at the top of your program and using
string.punctuation. (Try it on the IDLE Shell -- print
string.punctuation). You may find some of the other constants
in the string module useful such as string.ascii.lowercase or
string.ascii.uppercase or string.digits -- check them out!
5) the password must be between 8 and 12 characters long.
All your passwords should not have the same structure -- for
instance punctuation mark followed by capital letter followed by
digit etc. They need to be mixed up. I bet
there is a function that you can find that will do this part for
you! Find it!
The password generator should not take any parameters and it
should return the password as a string.
A few hints -- learn about random.choice() and random.randint(a,
b). To easily join all elements of a list into a string
(assuming all the elements are strings), you can use
newString = "".join(theList).
You may have a different way of writing this function, but I
would suggest that you create all the characters and put them into
a list first. Make sure that they are all strings. At
the end of the function you will use the join method shown above to
join all the characters together into a string.
Write a main function that will repeatedly ask the user if they
want to generate another user ID/password combination and display
it to them on the screen. Continue until they indicate that
they don't wish to generate any more values. (Yeah, I know,
printing the password on the screen is not secure ..... but we need
to see that you've done the assignment correctly!).
Note: If you are working on a mac, you may experience a a
certificate error. If so, add the following to the top of
your code:
import ssl
ssl._create_default_https_context =
ssl._create_unverified_context
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply