diff --git a/calculate.py b/calculate.py new file mode 100644 index 0000000000..6dc22cf124 --- /dev/null +++ b/calculate.py @@ -0,0 +1,33 @@ +import circle +import square + + +figs = ['circle', 'square'] +funcs = ['perimeter', 'area'] +sizes = {} + +def calc(fig, func, size): + assert fig in figs + assert func in funcs + + result = eval(f'{fig}.{func}(*{size})') + print(f'{func} of {fig} is {result}') + +if __name__ == "__main__": + func = '' + fig = '' + size = list() + + while fig not in figs: + fig = input(f"Enter figure name, avaliable are {figs}:\n") + + while func not in funcs: + func = input(f"Enter function name, avaliable are {funcs}:\n") + + while len(size) != sizes.get(f"{func}-{fig}", 1): + size = list(map(int, input("Input figure sizes separated by space, 1 for circle and square\n").split(' '))) + + calc(fig, func, size) + + + diff --git a/circle.py b/circle.py deleted file mode 100644 index c3eb8647c9..0000000000 --- a/circle.py +++ /dev/null @@ -1,10 +0,0 @@ -import math - - -def area(r): - return math.pi * r * r - - -def perimeter(r): - return 2 * math.pi * r - diff --git a/docs/README.md b/docs/README.md index 63f8727939..73ba4fcb29 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,9 @@ +# User agreement + +Please check out License Agreement for personal usage terms and limitations + +--- + # Math formulas ## Area - Circle: S = πR² @@ -7,4 +13,6 @@ ## Perimeter - Circle: P = 2πR - Rectangle: P = 2a + 2b -- Square: P = 4a \ No newline at end of file +- Square: P = 4a + +# Some change for Lesson 6 practice \ No newline at end of file diff --git a/square.py b/square.py deleted file mode 100644 index 0f98724205..0000000000 --- a/square.py +++ /dev/null @@ -1,7 +0,0 @@ - -def area(a): - return a * a - - -def perimeter(a): - return 4 * a diff --git a/triangle.py b/triangle.py new file mode 100644 index 0000000000..fb41f60a52 --- /dev/null +++ b/triangle.py @@ -0,0 +1,6 @@ +def area(a, b, c): + return (a + b + c) / 2 + + +def perimeter(a, b, c): + return a + b + c diff --git a/user_agreement.txt b/user_agreement.txt new file mode 100644 index 0000000000..5cc86cbd3d --- /dev/null +++ b/user_agreement.txt @@ -0,0 +1,14 @@ +License Agreement + +This License Agreement is made and effective as of 10 march 2021 by and between Smartiqa Group, a company organized and existing in Russian Federation, with a registered address at Moscow and User, a company organized and existing in Russian Federation, with a registered address at Moscow. + +1.1 “Agreement” means this License Agreement including the attached Schedule. + +1.2 “Confidential Information” means information that: +a. is by its nature confidential; +b. is designated in writing by Licensor as confidential; +c. the Licensee knows or reasonably ought to know is confidential; +d. Information comprised in or relating to any Intellectual Property Rights of Licensor. + +1.3 “Asset” means the Asset provided by Licensor as specified in Item 6 of the Schedule in the form as stated in Item 7 of the Schedule. +