subject

Validate Password Create a function in Python that will validate a password to make sure that password contains a specific character. This function needs to accept two parameters. The first parameter is a list that contains the letters for a word. The second parameter contains the character we want the program to look for. The function needs to return True if it finds the character and False if it does not. For example, let’s say that the following list and character are sent into the function:
["P", "a", "s", "s", "&", "W", "o", "r", "d"] "&"
The function would return back to main.
As with the previous problem, the best way to code this is to open VS Code or IDLE and create your function. You can use the following code to test your function:
def main():
myword = ["" * 9]
mycharacter = str()
myfound = bool()
myword = ["P", "a", "s", "s", "&", "W", "o", "r", "d"]
mycharacter = "&"
myfound = ValidatePassword(myword, mycharacter)
print(myfound)
main()
Your code should print out the following:
True
Once your output matches this output it is safe to move your function code only to Codio for further testing. Although the sample list above contains a list with 8 elements elements, make sure your code can accommodate a list that is either smaller than the one above or larger. (HINT: use the len() function.)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:00
Which demographic challenge is europe currently experiencing? a. an aging and decreasing population b. a baby boomc. an unequal distribution between males and females d. a large group of teenagers moving through the school system(i chose a but i'm unsure)
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Apunishment or the threat of punishment used to enforce conformity. select the best answer from the choices provided t f
Answers: 1
question
Computers and Technology, 24.06.2019 00:50
3. what is the output of the following statements? temporary object1; temporary object2("rectangle", 8.5, 5); temporary object3("circle", 6, 0); temporary object4("cylinder", 6, 3.5); cout < < fixed < < showpoint < < setprecision(2); object1.print(); object2.print(); object3.print(); object4.print(); object1.set("sphere", 4.5, 0); object1.print();
Answers: 1
You know the right answer?
Validate Password Create a function in Python that will validate a password to make sure that passwo...
Questions
question
Mathematics, 01.04.2020 20:00
Questions on the website: 13722367