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, 22.06.2019 13:30
Write lines of verse that rhyme to remember the following information: acid rain is a type of air pollution caused by chemicals in the air.
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Write a method so that the main() code below can be replaced by the simpler code that calls method original main(): public class calcmiles { public static void main(string [] args) { double milesperhour; double minutestraveled; double hourstraveled; double milestraveled; milesprhour = scnr.nextdouble(); minutestraveled = scnr.nextdouble(); hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; system.out.println("miles: " + milestraveled); } }
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
question
Computers and Technology, 23.06.2019 22:50
What is an rss reader used for? for creating a user account on a social new site
Answers: 2
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, 16.09.2020 09:01
question
Chemistry, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Biology, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Social Studies, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Biology, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
Questions on the website: 13722361