rocket-nour03112005 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rocket_nour03112005-1.0.0/PKG-INFO +9 -0
- rocket_nour03112005-1.0.0/README.md +29 -0
- rocket_nour03112005-1.0.0/rocket.py +36 -0
- rocket_nour03112005-1.0.0/rocket_nour03112005.egg-info/PKG-INFO +9 -0
- rocket_nour03112005-1.0.0/rocket_nour03112005.egg-info/SOURCES.txt +7 -0
- rocket_nour03112005-1.0.0/rocket_nour03112005.egg-info/dependency_links.txt +1 -0
- rocket_nour03112005-1.0.0/rocket_nour03112005.egg-info/top_level.txt +1 -0
- rocket_nour03112005-1.0.0/setup.cfg +4 -0
- rocket_nour03112005-1.0.0/setup.py +10 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# package_name
|
|
2
|
+
|
|
3
|
+
`package_name` is a Python library for ..........
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install `package_name`.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install package_name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
import package_name
|
|
17
|
+
|
|
18
|
+
# returns 'words'
|
|
19
|
+
package_name.module_name('word')
|
|
20
|
+
|
|
21
|
+
# returns 'geese'
|
|
22
|
+
package_name.module_name('goose')
|
|
23
|
+
|
|
24
|
+
# returns 'phenomenon'
|
|
25
|
+
package_name.module_name('phenomena')
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from math import sqrt, pi
|
|
2
|
+
|
|
3
|
+
class Rocket:
|
|
4
|
+
def __init__(self, x=0, y=0):
|
|
5
|
+
self.x = x
|
|
6
|
+
self.y = y
|
|
7
|
+
|
|
8
|
+
def __eq__(self, other):
|
|
9
|
+
return self.x == other.x and self.y == other.y
|
|
10
|
+
|
|
11
|
+
def get_distance(self, other):
|
|
12
|
+
return sqrt((self.x - other.x)**2 + (self.y - other.y)**2)
|
|
13
|
+
|
|
14
|
+
def __str__(self):
|
|
15
|
+
return f"Rocket at ({self.x}, {self.y})"
|
|
16
|
+
|
|
17
|
+
def __repr__(self):
|
|
18
|
+
return f"Rocket({self.x}, {self.y})"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Shuttle(Rocket):
|
|
22
|
+
def __init__(self, x=0, y=0, flights_completed=0):
|
|
23
|
+
super().__init__(x, y)
|
|
24
|
+
self.flights_completed = flights_completed
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CircleRocket(Rocket):
|
|
28
|
+
def __init__(self, x=0, y=0, radius=1):
|
|
29
|
+
super().__init__(x, y)
|
|
30
|
+
self.radius = radius
|
|
31
|
+
|
|
32
|
+
def get_area(self):
|
|
33
|
+
return pi * self.radius**2
|
|
34
|
+
|
|
35
|
+
def get_circumference(self):
|
|
36
|
+
return 2 * pi * self.radius
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rocket
|