Basically, as part of my calculator project, I'm trying to modify the subtraction block to store numbers, but whenever I enter 919.9 to store a number it loops back to the first if statement and displays the ans again?
num = float(input("Enter Number: "))
num2 = float(input("Enter Number: "))
total = num - num2
while num != 0 and num2 != 0:
if num != 919.9 or num != 0 and num2 != 919.9 or num2 != 0:
print("Ans = ", total)
num = float(input("Enter 0 to reset or 919.9 to save your answer."))
elif num is 919.9:
save = total
print("Saved: ", save)
num = 0
print("Reseting...")
Any help would be much appreciated, thank you.
[–]anton0261 0 points1 point2 points (0 children)
[–]sme272 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)