Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
If, elif, else solution in Clear category for Autopilot by H0r4c3
def speed_adjust(A: int, B: int, C: int) -> int:
if (B-A) > (C-B):
return -1
elif (B-A) < (C-B):
return 1
else:
return 0
print("Example:")
print(speed_adjust(2, 4, 6))
# These "asserts" are used for self-checking
assert speed_adjust(0, 2, 6) == 1
assert speed_adjust(0, 4, 6) == -1
assert speed_adjust(0, 3, 6) == 0
print("The mission is done! Click 'Check Solution' to earn rewards!")
Dec. 2, 2024