Sure! Below is a simple Python code for a basic calculator that can perform addition, subtraction, multiplication, and division. You can extend it according to your needs.
```python
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def divide(x, y):
if y == 0:
return "Error! Division by zero."
return x / y
def main():
print("Select operation:")
print("1. Add")