Course Solutions Uncategorized (Solved) : Following Program Segment Designed Report Positive Integers X Y Larger Program Segment Cor Q29686899 . . . .

(Solved) : Following Program Segment Designed Report Positive Integers X Y Larger Program Segment Cor Q29686899 . . . .

 

The following program segment is designed to report which of thepositive integers X and Y is larger. Is the program segmentcorrect? Implement the program in Python, test the program segmentto ensure it is correct using various inputs and answer thequestion. If this code needs to be corrected what would you add tofix it?

Difference = X- Y

if (Difference is positive)

print(‘X is bigger than Y’)

else:

print(‘Y is bigger than X’)

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post