Write a python
program that asks user for two numbers and prints Close if the numbers are within .001 of each other and Not close otherwise
Answers
Answered by
44
Answer:
num1 = int(input("Enter number 1 : "))
num2 = int(input("Enter number 2 : "))
if num1 + 0.01 == num2:
print("close")
elif num2 + 0.01 == num1:
print("close")
else:
print("Not Close")
Output:
Enter number 1 : 15.01
Enter number 2 : 15.02
close
-------hope you understood this :)
Answered by
12
Answer:
num1 = float(input("Enter number 1 : "))
num2 = float(input("Enter number 2 : "))
if num1 + 0.001 == num2:
print("close")
elif num2 + 0.001 == num1:
print("close")
else:
print("Not Close")
Explanation:
Similar questions