Write a python function, find_correct() which accepts a dictionary and returns a list as per the rules mentioned below. The input dictionary will contain correct spelling of a word as key and the spelling provided by a contestant as the value.

Write a python function, find_correct() which accepts a dictionary and returns a list as per the rules mentioned below.
The input dictionary will contain correct spelling of a word as key and the spelling provided by a contestant as the value.

The function should identify the degree of correctness as mentioned below:
CORRECT, if it is an exact match
ALMOST CORRECT, if no more than 2 letters are wrong
WRONG, if more than 2 letters are wrong or if length (correct spelling versus spelling given by contestant) mismatches.

and return a list containing the number of CORRECT answers, number of ALMOST CORRECT answers and number of WRONG answers. 
Assume that the words contain only uppercase letters and the maximum word length is 10.

Also write the pytest test cases to test the program.

#PF-Assgn-48

def find_correct(word_dict):
    #start writing your code here
    key=[]
    value=[]
    count=0
    correct=0
    wrong=0
    atmost=0
    result=[]
    for i,j in word_dict.items():
            key.append(i)
            value.append(j)
    for i in range(len(key)):
        if(len(key[i])==len(value[i]) and key[i]==value[i]):
            correct+=1
        elif((len(key[i])==len(value[i]))==False):
            wrong+=1
        else:
            for j in range(len(key[i])):
                if((key[i][j]==value[i][j])==False):
                    count+=1
                    if(count>2):
                        wrong+=1
                        break
            if(count<=2):
                atmost+=1
            count=0
           
           
    result=[correct,atmost,wrong]
    return result
       


word_dict={"THEIR": "THEIR","BUSINESS":"BISINESS","WINDOWS":"WINDMILL","WERE":"WEAR","SAMPLE":"SAMPLE"}
print(find_correct(word_dict))


The below function is written to check whether a given three digit number is an Armstrong number. Hint: An “Armstrong number” is an n-digit number that is equal to the sum of the nth powers of its individual digits. Example: 371 is an Armstrong number as 371 = 3^3 +7^3+ 1^3

The below function is written to check whether a given three digit number is an Armstrong number.

Hint: An “Armstrong number” is an n-digit number that is equal to the sum of the nth powers of its individual digits.
Example: 371 is an Armstrong number as 371 = 3^3 +7^3+ 1^3



Source:

Write a python function find_duplicates(), which accepts a list of numbers and returns another list containing all the duplicate values in the input list. If there are no duplicate values, it should return an empty list.


Write a python function find_smallest_number() which accepts a number n and returns the smallest number having n divisors. Handle the possible errors in the code written inside the function.












Source Code:-

Given a number n, write a program to find the sum of the largest prime factors of each of nine consecutive numbers starting from n. g(n) = f(n) + f(n+1) + f(n+2) + f(n+3) + f(n+4) + f(n+5) + f(n+6) + f(n+7) + f(n+8) where, g(n) is the sum and f(n) is the largest prime factor of n For example, g(10)=f(10)+f(11)+f(12)+f(13)+f(14)+f(15)+f(16)+f(17)+f(18)=5 + 11 + 3 + 13 + 7 + 5 + 2 + 17 + 3 =66

Given a number n, write a program to find the sum of the largest prime factors of each of nine consecutive numbers starting from n.
g(n) = f(n) + f(n+1) + f(n+2) + f(n+3) + f(n+4) + f(n+5) + f(n+6) + f(n+7) + f(n+8)
where, g(n) is the sum and f(n) is the largest prime factor of n

For example,
g(10)=f(10)+f(11)+f(12)+f(13)+f(14)+f(15)+f(16)+f(17)+f(18) 
        =5 + 11 + 3 + 13 + 7 + 5 + 2 + 17 + 3 
        =66 
 Source Code:-

A 10-substring of a number is a substring of its digits that sum up to 10. For example, the 10-substrings of the number 3523014 are: 3523014, 3523014, 3523014, 3523014

A 10-substring of a number is a substring of its digits that sum up to 10.

For example, the 10-substrings of the number 3523014 are:
3523014, 3523014, 3523014, 3523014

Write a python function, find_ten_substring(num_str) which accepts a string and returns the list of 10-substrings of that string.

Handle the possible errors in the code written inside the function.


Write a recursive function, is_palindrome() to find out whether a string is a palindrome or not. The function should return true, if it is a palindrome. Else it should return false.

Source Code:-

Write a python function, find_correct() which accepts a dictionary and returns a list as per the rules mentioned below. The input dictionary will contain correct spelling of a word as key and the spelling provided by a contestant as the value.

Write a python function,  find_correct()  which accepts a dictionary and returns a list as per the rules mentioned below. The input diction...