From d080c7888b81955bad2ed78d58ad910526b5132a Mon Sep 17 00:00:00 2001 From: smartiqa Date: Fri, 26 Mar 2021 14:48:39 +0300 Subject: [PATCH 1/6] L-04: Triangle added --- triangle.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 triangle.py 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 From 51c40ebfd0e0b65f52fe5e54740cbb038e492db3 Mon Sep 17 00:00:00 2001 From: smartiqa Date: Fri, 26 Mar 2021 14:52:26 +0300 Subject: [PATCH 2/6] L-04: Doc updated for triangle --- docs/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 63f8727939..0825daceef 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,8 +3,10 @@ - Circle: S = πR² - Rectangle: S = ab - Square: S = a² +- Triangle: S = (a + b + c) / 2 ## Perimeter - Circle: P = 2πR - Rectangle: P = 2a + 2b -- Square: P = 4a \ No newline at end of file +- Square: P = 4a +- Triangle: P = a + b + c From 689bf0da98906952ad97b0c097efa90a87da3abe Mon Sep 17 00:00:00 2001 From: "Daniil.K" Date: Tue, 30 Mar 2021 18:02:23 +0300 Subject: [PATCH 3/6] L-04: Added calculate.py and updated docs --- calculate.py | 33 +++++++++++++++++++++++++++++++++ docs/README.md | 25 +++++++++++++++++-------- 2 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 calculate.py 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/docs/README.md b/docs/README.md index 0825daceef..209eaca532 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,12 +1,21 @@ + +# How to use calculator: +1. Run `python calculate.py` +2. Enter the figure name. Available are Circle, Square. +3. Enter the function: Area or Perimeter. +4. Enter figure sizes. Radius for circle, one side for square. +5. Get the answer! + # Math formulas ## Area -- Circle: S = πR² -- Rectangle: S = ab -- Square: S = a² -- Triangle: S = (a + b + c) / 2 +- Circle: `S = πR²` +- Rectangle: `S = ab` +- Square: `S = a²` +- Triangle: `S = sqrt(p * (p-a) * (p-b) * (p-c))` where p is semiperimeter ## Perimeter -- Circle: P = 2πR -- Rectangle: P = 2a + 2b -- Square: P = 4a -- Triangle: P = a + b + c +- Circle: `P = 2πR` +- Rectangle: `P = 2a + 2b` +- Square: `P = 4a` +- Triangle: `P = a + b + c` + From dcc5447aad1f158370c99964d271a632a94e957b Mon Sep 17 00:00:00 2001 From: "Daniil.K" Date: Tue, 30 Mar 2021 18:02:23 +0300 Subject: [PATCH 4/6] L-05: Experimental features --- calculate.py | 33 +++++++++++++++++++++++++++++++++ circle.py | 10 ---------- docs/README.md | 25 +++++++++++++++++-------- square.py | 7 ------- 4 files changed, 50 insertions(+), 25 deletions(-) create mode 100644 calculate.py delete mode 100644 circle.py delete mode 100644 square.py 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 0825daceef..209eaca532 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,12 +1,21 @@ + +# How to use calculator: +1. Run `python calculate.py` +2. Enter the figure name. Available are Circle, Square. +3. Enter the function: Area or Perimeter. +4. Enter figure sizes. Radius for circle, one side for square. +5. Get the answer! + # Math formulas ## Area -- Circle: S = πR² -- Rectangle: S = ab -- Square: S = a² -- Triangle: S = (a + b + c) / 2 +- Circle: `S = πR²` +- Rectangle: `S = ab` +- Square: `S = a²` +- Triangle: `S = sqrt(p * (p-a) * (p-b) * (p-c))` where p is semiperimeter ## Perimeter -- Circle: P = 2πR -- Rectangle: P = 2a + 2b -- Square: P = 4a -- Triangle: P = a + b + c +- Circle: `P = 2πR` +- Rectangle: `P = 2a + 2b` +- Square: `P = 4a` +- Triangle: `P = a + b + c` + 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 From d2c036bbd57e4fcd62682741c9fc6cc568499ae9 Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 19 Apr 2021 15:12:19 +0300 Subject: [PATCH 5/6] L-05: Add user agreement L-05: Update Docs. Add user agreement info --- docs/README.md | 24 ++++++++++-------------- user_agreement.txt | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 user_agreement.txt diff --git a/docs/README.md b/docs/README.md index 209eaca532..e7c5d827a9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,21 +1,17 @@ +# User agreement -# How to use calculator: -1. Run `python calculate.py` -2. Enter the figure name. Available are Circle, Square. -3. Enter the function: Area or Perimeter. -4. Enter figure sizes. Radius for circle, one side for square. -5. Get the answer! +Please check out License Agreement for personal usage terms and limitations + +--- # Math formulas ## Area -- Circle: `S = πR²` -- Rectangle: `S = ab` -- Square: `S = a²` -- Triangle: `S = sqrt(p * (p-a) * (p-b) * (p-c))` where p is semiperimeter +- Circle: S = πR² +- Rectangle: S = ab +- Square: S = a² ## Perimeter -- Circle: `P = 2πR` -- Rectangle: `P = 2a + 2b` -- Square: `P = 4a` -- Triangle: `P = a + b + c` +- Circle: P = 2πR +- Rectangle: P = 2a + 2b +- Square: P = 4a 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. + From bf76c9bca4a4570d9a0b8696b8abc6540d6b80af Mon Sep 17 00:00:00 2001 From: Git Course User Date: Tue, 19 May 2026 23:27:44 +0500 Subject: [PATCH 6/6] G-06: README change for practice --- docs/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/README.md b/docs/README.md index e7c5d827a9..73ba4fcb29 100644 --- a/docs/README.md +++ b/docs/README.md @@ -15,3 +15,4 @@ Please check out License Agreement for personal usage terms and limitations - Rectangle: P = 2a + 2b - Square: P = 4a +# Some change for Lesson 6 practice \ No newline at end of file