def calculate(num1, num2, operator):
    if operator == '+':
        return num1 + num2
    elif operator == '-':
        return num1 - num2
    elif operator == '*':
        return num1 * num2
    elif operator == '/':
        if num2 != 0:
            return num1 / num2
        else:
            return "Error: Division by zero"
    else:
        return "Error: Invalid operator"

def main():
    while True:
        try:
            num1 = float(input("Enter the first number: "))
            num2 = float(input("Enter the second number: "))
            operator = input("Enter the operator (+, -, *, /): ")

            result = calculate(num1, num2, operator)
            print(f"The result is: {result}")

            choice = input("Do you want to perform another calculation? (yes/no): ")
            if choice.lower() != 'yes':
                break
        except ValueError:
            print("Error: Invalid input. Please enter a valid number.")
        except ZeroDivisionError:
            print("Error: Division by zero")

if __name__ == "__main__":
    main()