What is the best way to print the results of this math calculation to a document like .txt? What am i doing wrong?
def divide(x, y):
return x / y
print("Menu.")
print("1.Offers")
while True:
choice = input("Choose1(1): ")
if choice in ('1'):
num1 = float(input("Price: "))
num2 = float(input("Surcharge: "))
if choice == '1':
print(num1, "/", num2, "==", divide(num1, num2))
break
else:
print("Invalid Input")