# Used "==" and "is" for equality
print(48 / 10 == 48 * 0.1)
print(48 / 10 is 48 * 0.1)
print()
# Check Both Answers Individually
print(f"48 / 10 = {48 / 10}")
print(f"48 * 0.1 = {48 * 0.1}")
In the following code, I thought both expressions would equal each other, but they do not. This is what it outputs.
False
False
48 / 10 = 4.8
48 * 0.1 = 4.800000000000001
Can someone explain why there is a difference in the result, whether you are using division or multiplication?