PLEASE HELP
7.6 LAB: Replacement words 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 :

This assignment is required to be executed in python programming language. See the code below.

What is the code that displays word pairs that differ between the two sentences?

# taking two sentence as input s1 = input() s2 = input()  

# getting the words in both sentences in list w1 = s1.split() w2 = s2.split()  # looping through the word lists and checking if they are equal or not for i in range(len(w1)):  

# printing word pairs if they are not equal

if (w1[i] != w2[i]):

 print(w1[i],w2[i])    

Learn more about python programming language at;
https://brainly.com/question/26497128
#SPJ1