Write a program that finds word differences between two sentences. The input begins with the first sentence and the following input line is the second sentence. Assume that the two sentences have the same number of words. The program displays word pairs that differ between the two sentences. One pair is displayed per line. Ex: if the input is: smaller cars get better gas mileage tiny cars get great fuel economy then the output is: smaller tiny better great gas fuel mileage economy hint: store each input line into a list of strings.

Respuesta :

Below is the code of a program that that finds word differences between two sentences by using Python programming language.

Coding Part:

class Solution(object):  

   def findTheDifference(self, s, t):  

       ls_si = [si[i] for i in range(len(si))]  

       ls_ti = [ti[i] for i in range(len(ti))]  

       for elem in ls_s:  

           ls_t.remove(elem)  

       return(ls_t[0])  

obj = Solution()  

s = "zxyc"  

t = "zxyce"  

print(obj.findTheDifference(s, t)

What is Python Programming?

Python is a well-known all-purpose programming language. It's used in machine learning, web development, desktop applications, and a variety of other applications. Python, fortunately, has a simple, easy-to-use syntax for beginners. Python is therefore an excellent language for beginners to learn.

To know more about Python Programming, visit: https://brainly.com/question/26497128

#SPJ4

ACCESS MORE