Python Programming: Write a function, called intDiff, that takes 3 integer values as arguments : a, b and c, return True
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Python Programming: Write a function, called intDiff, that takes 3 integer values as arguments : a, b and c, return True
Python Programming: Write a function, called intDiff, that takes3 integer values as arguments : a, b and c, return True if one of bor c differs from a by at most 1, while the other differs from bothother values by 2 or more. For example, 1, 2, 9 returns Truebecause 2 (which is b) differs from 1 (which is a) by 1 and 9(which is c) differs from both 1 (a) and 2 (b) by more than 2,while 1, 2, 3 returns False. Hint: abs(num) computes the absolutevalue of a number.