Question: Use a for loop please! Create a Python function called countDiffs that takes two arguments, both of which are strings of the same length. (You

Use a for loop please!

Create a Python function called countDiffs that takes two arguments, both of which are strings of the same length. (You don't need to verify that the strings are the same length.) Your function should compare the two strings, character by character, and counts the number of times the two strings have different characters in the same location (i.e., at the same integer index). Your function should then return that number. Here are some examples of how your function should behave:

>>> countDiffs("abcdef","acceef")

2 >>> countDiffs("abc","abc") 0

>>> countDiffs("abc","xyz")

3 >>> countDiffs("","") 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!