Error Detection
Error Detection
TECHNIQUE
Example:-
Let’s say,
Input:
String 1 = ‘Cat’
String 2 = ‘Car’
Output: 1
if __name__ == '__main__':
str1 = 'Cats'
str2 = 'Rats'
print('No. of Operations required :',edit_distance(str1, str2, len(str1), len(str2)))
str3 = 'Saturday'
str4 = 'Sunday'
print('No. of Operations required :',edit_distance(str3, str4, len(str3), len(str4)))
------------------------------------------------------------------------------------------------------------
Case 1-:-
Input :
str1 = ‘cat’
Str2 = ‘rat’
No. of operation required :1
WAP FOR COUNTDOWN USING
RECURSION
def count(n):
if n<1:
return
print(n,end=‚ ‚)
return count(n-1)
count(10)
OUTPUT:
10 9 8 7 6 5 4 3 2 1
Thank You!