Question: Assume that a and b have been assigned two different float values. Write a ( possibly nested ) if - elif - else statement that

Assume that a and b have been assigned two different float values. Write a (possibly nested) if-elif-else statement that compares b - a and makes the following assignments, based on the result:
if b - a is less than 0, assign 1 to low and 0 to high;
if b - a is greater than 0, assign 0 to low and 1 to high;
if b - a equals 0, assign 0 to both low and high.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!