Jun-18-2024, 07:22 PM
(This post was last modified: Jun-18-2024, 07:23 PM by zimmytheflygirl.)
#division calculation elif choice == divF: try: num1 = int(input("Enter first number: ")) num2 = int(input("Enter second number: ")) if num1 != 0 and num2 != 0: answer = float(input("Enter answer:")) c_answer = (num1 / num2) if c_answer == answer: print("Correct, great job!") else: print(f'Incorrect, the answer is {c_answer:.2f} .') else: print("Cannot divide with zero, try again.") except ZeroDivisionError: print ('Error')I actually just changed it to this...I am just trying so many things and learning as I go (even though I am taking this as a class).
so after the else...it needs to go back to the num1 and num2.