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 08:50
Can online classes such as gradpoint track your ip location like if im taking a final and i give somebody else my account and they take the final for me will it show where they are taking the final from? and can this be countered with a vpn
Answers: 1
question
Computers and Technology, 22.06.2019 22:40
When you type the pwd command, you notice that your current location on the linux filesystem is the /usr/local directory. answer the following questions, assuming that your current directory is /usr/local for each question. a. which command could you use to change to the /usr directory using an absolute pathname? b. which command could you use to change to the /usr directory using a relative pathname? c. which command could you use to change to the /usr/local/share/info directory using an absolute pathname? d. which command could you use to change to the /usr/local/share/info directory using a relative pathname? e. which command could you use to change to the /etc directory using an absolute pathname? f. which command could you use to change to the /etc directory using a relative pathname?
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
In which of the following ways can using test-taking tips you? a. you can focus on the information that you need to study. b. you will see the answers to the test. c. you will study more. d. you will be less organized.
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
Append and make table queries are called queries. select complex simple action i think action
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, 29.01.2020 03:41
question
Mathematics, 29.01.2020 03:41
question
Mathematics, 29.01.2020 03:41
question
Mathematics, 29.01.2020 03:41
question
English, 29.01.2020 03:41