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, 23.06.2019 06:30
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
question
Computers and Technology, 23.06.2019 12:50
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
What is the biggest difference between section breaks and regular page breaks? section breaks are more difficult to add than page breaks. section breaks make it easier for you to view the document as an outline. section breaks allow you to have areas of the document with different formatting. section breaks are smaller than regular page breaks.
Answers: 2
question
Computers and Technology, 24.06.2019 17:30
Click on the tab on the ribbon to open the backstage view. file view insert review
Answers: 1
You know the right answer?
PYTHON: Defining a Figure of Merit
Consider a string-matching figure of merit. That is, it t...
Questions
question
Physics, 30.04.2021 17:10
question
Mathematics, 30.04.2021 17:10
question
SAT, 30.04.2021 17:10
question
Mathematics, 30.04.2021 17:10
Questions on the website: 13722359