subject

PYTHON: Defining a Figure of Merit
Consider a string-matching figure of merit. That is, it tells you how close to a given string another string is. Each matching letter in the same spot is worth one point. Only letters need be considered.
For instance, if the secret string reads 'BLACKBEARD', then 'BEACKBEARD' is worth 9 points, 'WHITEBEARD' is worth 5 points, 'BEARDBLACK' is worth 4 points, and 'CALICOJACK' is worth 1 point.
Compose a function pirate which accepts a string of characters guess and returns the number of characters which match the secret string 'BLACKBEARD'. It should be case-insensitive; that is, you should convert input to upper-case letters. It should return zero for strings which are not ten characters in length.
Your submission should include a function pirate( guess ) which returns a float or int representing the number of matching characters. (You should provide the secret string 'BLACKBEARD' inside the function, not outside of it.)
strings should not have same lengths

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
Choose the best explanation for the following statement communication is symbolic
Answers: 3
question
Computers and Technology, 22.06.2019 10:40
When running anti-virus software , what could be a reason where recipitent is not guaranteed that data being streamed will not get interrupted?
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
How to do this programming flowchart?
Answers: 3
You know the right answer?
PYTHON: Defining a Figure of Merit
Consider a string-matching figure of merit. That is, it t...
Questions
question
Mathematics, 09.06.2020 20:57