Question: solve using python 18. In this problem, we'll call two numbers close if the absolute value of their difference is less than or equal to
18. In this problem, we'll call two numbers close if the absolute value of their difference is less than or equal to 2. So, for example, 17 and 19 are close, as are 20 and 20, but 13 and 16 are not close. I have some code that starts out with xyz - (17, 20, 30] # The three numbers here may change n - int (input("Enter an integer: ')) I write code that is supposed to identify if xyz contains at least one element close to n and at least one element not close to n. For example, if the user inputs 18, the program should print out One close, one not close, since 17 is close to 18, and 30 is not close to 18 - there may be others as well, but there is at least one of each. But if abs(xyz[0] - n)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
