-
Notifications
You must be signed in to change notification settings - Fork 0
Contribution
Gleb Rodukov edited this page Oct 14, 2022
·
10 revisions
- Fork this repository;
- Add math formula to
src/mathframework/
; - Run
main.py
and test your program; - Commit your updates;
- Create Pull Request and wait reviewer's reaction. If it will be successful i publish it.
# Import modules which you want
import math
# create a class with the same name as the file
class pythagorean_theorem:
# Information about your package
class Meta:
name = "Pythagorean Theorem"
package = "pythagorean_theorem"
description = "takes at least two arguments, you must specify whether it is a cathet or a hypotenuse"
creator = "Gleb Rodukov<electroneuphoria@gmail.com>"
# function example (you can name it as you want)
# You can create unlimited number of functions
def pythagorean_theorem(cathet1: float = None, cathet2: float = None, hypotenuse: int = None) -> float:
"This function is working Pythagorean Theorem"
if cathet1 == None:
return math.sqrt(
hypotenuse**2 - cathet2**2
)
elif cathet2 == None:
return math.sqrt(
hypotenuse**2 - cathet1**2
)
elif hypotenuse == None:
return math.sqrt(
cathet1**2 + cathet2**2
)
else:
return False