Computers and Technology

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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:00, hailee232
What is a society that has moved to the internet rather than relying on physical media called
Answers: 2
image
Computers and Technology, 22.06.2019 17:30, bl88676
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
image
Computers and Technology, 25.06.2019 00:30, marziel24
Which type of cell references are locked and not automatically updated when it’s copied a)formula b)relative c)absolute d)worksheet
Answers: 1
image
Computers and Technology, 25.06.2019 07:50, munekalove69ounxwv
The “tab” key can a. create extra cells in a word table *b. move from cell to cell in a word table c. move from the top of a column to the bottom of a column in a word table d. none of the above a. none of these answers are correct b. move from cell to cell in a word table c. move from the top of a column to the bottom of a column in a word table d. create extra cells in a word table
Answers: 2
Do you know the correct answer?
PYTHON: Defining a Figure of Merit
Consider a string-matching figure of merit. That is, it t...

Questions in other subjects:

Konu
Mathematics, 09.03.2021 07:20
Konu
Mathematics, 09.03.2021 07:20