Download example.py from armaanalam/CodeBase-Agent: direct link, hf CLI and curl.
- Browser
- Download file 551 Bytes
-
https://huggingface.co/armaanalam/CodeBase-Agent/resolve/refs%2Fpr%2F1/example.py
- Command line
-
hf download hf://armaanalam/CodeBase-Agent@refs/pr/1/example.py
-
curl -L -o example.py https://huggingface.co/armaanalam/CodeBase-Agent/resolve/refs%2Fpr%2F1/example.py
551 Bytes
| class Area: | |
| # Function to calculate rectangle area | |
| def rectangle_area(self, length, width): | |
| return length * width | |
| # Function to calculate square area | |
| def square_area(self, side): | |
| return side * side | |
| # Create object | |
| obj = Area() | |
| # Input | |
| length = int(input("Enter length of rectangle: ")) | |
| width = int(input("Enter width of rectangle: ")) | |
| side = int(input("Enter side of square: ")) | |
| # Output | |
| print("Rectangle Area =", obj.rectangle_area(length, width)) | |
| print("Square Area =", obj.square_area(side)) |