We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write the code to implement the calculator logic
The text was updated successfully, but these errors were encountered:
#!/bin/bash
touch calculator.py
cat << EOF > calculator.py
class Calculator: def add(self, num1, num2): return num1 + num2
def subtract(self, num1, num2): return num1 - num2 def multiply(self, num1, num2): return num1 * num2 def divide(self, num1, num2): if num2 == 0: raise ValueError("Cannot divide by zero") return num1 / num2
calc = Calculator()
print(calc.add(5, 10)) print(calc.subtract(15, 7)) print(calc.multiply(3, 4)) print(calc.divide(20, 5)) EOF
cat calculator.py
Sorry, something went wrong.
No branches or pull requests
Write the code to implement the calculator logic
The text was updated successfully, but these errors were encountered: