PYTHON:
Defining a Figure of Merit
Consider a string-matching figure of merit. That is, it t...
Computers and Technology, 23.04.2021 16:10 sipstick9411
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
Answers: 2
Computers and Technology, 22.06.2019 10:00
Create a word problem that involves calculating the volume and surface area of a three-dimensional object. cube: surface area 6 s2 , volume s3
Answers: 3
Computers and Technology, 24.06.2019 07:00
You are most likely to automatically encode information about
Answers: 1
Computers and Technology, 24.06.2019 10:00
Which feature of a blog to restore and retrieve older post
Answers: 3
Computers and Technology, 25.06.2019 08:00
The heart of a computer.basic input/output systemselectmain memoryserial portcentral processing unit (cpu)
Answers: 3
Mathematics, 12.01.2021 15:50
Business, 12.01.2021 15:50
English, 12.01.2021 15:50
Mathematics, 12.01.2021 15:50
Mathematics, 12.01.2021 15:50
Mathematics, 12.01.2021 15:50
Mathematics, 12.01.2021 15:50
Advanced Placement (AP), 12.01.2021 15:50
Geography, 12.01.2021 15:50
Mathematics, 12.01.2021 15:50
History, 12.01.2021 15:50