Question: USING PYTHON PROGRAMMING LANGUAGE 5. Write a whole program that does the following: The program should create 8-letter passwords, made up of 8 random letters,
USING PYTHON PROGRAMMING LANGUAGE
5. Write a whole program that does the following: The program should create 8-letter passwords, made up of 8 random letters, until the user is satisfied Specifically, it should do the following repeatedly: first, it should print out a random password. Then, it should ask the user if the password is satisfactory. If the user enters y, the program ends; if the user enters n, everything repeats. (You may assume the user enters only y or n.) For full credit, you should use a FUNCTION that takes NO arguments, and returns a string (the random password). Hints : to create a random letter, import random and string, and use random.choice (string.letters). To create the full random password, start with an empty string, and += random lowercase letters on to the end, one letter at a time. 6. Two words are called granagrams if they have the same number of gs AND the same number of rs in them. For instance, greening and reigning are granagrams, because they each have two g's and one r. ggrrrh and Irxkabgrg are granagrams, while rage and garbage are not. Write a whole program that does the following: first, it asks the user to enter two words. Then, the program will print Granagrams or Not Granagrams depending on whether those two words are granagrams . ASSUME that all letters entered are LOWERCASE, and each word contains no spaces. For full credit, you should use a FUNCTION - or perhaps a couple, your choice - which returns a count of the number of appearances of a certain letter in a string. So your function(s) should have at least one argument which is a string, and should return an int - beyond that is up to you. DO NOT USE .count (O
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
