Question: def close _ far ( a: int, b: int, c:int ) bool: Return True if one of the varaibles is close to

def close_far(a: int, b: int, c:int) bool:
"""Return True if one of the varaibles is close to the other and far from the third one. Otherwise return False
>>>closefar(1,2,3)
>>>closefar(15,7,9)
>>>closefar(5,17,16)
>>>closefar(3,4,9)
#a and b are close:
if ?abs(a-b)==1 :
if ?abs(b-c)2 :
if ?abs(a-c)2 :
return True
#a and c are close:
elif ?abs(a-c)==1 :
if ?abs(b-a)2 :
if ?abs(b-c)2 :
return True
#b and c are close:
elif ?abs(b-c)==1 :
if ?abs(b-a)2 :
if ?abs(a-c)2 :
return True
else:
return False
 def close_far(a: int, b: int, c:int) bool: """Return True if one

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 Databases Questions!