Jun-21-2024, 11:58 PM
Solved it...
#division calculation elif choice == divF: while (num1 := int(input('Enter first number: '))) == 0: print ('Number must not be a zero.') while (num2 := int(input("Enter second number: "))) == 0: print ('Number must not be a zero.') answer = float(input("Enter answer (to 2 decimal points): ")) c_answer = float(num1 / num2) #output if c_answer == answer: print("Correct, great job!") else: print("Incorrect, the answer is ", f'{c_answer:.2f}',".")And it works perfectly :) it loops back to the question until a number other than zero is entered.