Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Изменены файлы README.md и Rectangle.py #20

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/Python-github-wb.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Math formulas
# TODO Площадь
## Area
### Площадь окружности
- Circle: S = πR²
### Площадь прямоугольника
- Rectangle: S = ab
### Площадь квадрата
- Square: S = a²

# TODO Периметр
## Perimeter
### Длина окружности
- Circle: P = 2πR
### Периметр прямоугольника
- Rectangle: P = 2a + 2b
### Периметр квадрата
- Square: P = 4a
11 changes: 11 additions & 0 deletions Rectangle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
a = int(input("Ввведите длину стороны прямоугольника a = "))
b = int(input("Ввведите длину стороны прямоугольника b = "))
def area(a, b):
return a * b
S = area(a, b)
print("Площадь прямоугольника S = ", S)

def perimeter(a, b):
return 2 * a + 2 * b
P = perimeter(a, b)
print("Периметр прямоугольника P = ", P)
7 changes: 5 additions & 2 deletions circle.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import math

r = int(input("Ввведите радиус окружности R = "))

def area(r):
return math.pi * r * r

S = area(r)
print("Площадь окружности S = ", S)

def perimeter(r):
return 2 * math.pi * r
P = perimeter(r)
print("Длина окружности P = ", P)
7 changes: 5 additions & 2 deletions square.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
r = int(input("Ввведите длину стороны квадрата a = "))
def area(a):
return a * a


S = area(r)
print("Площадь квадрата S = ", S)
def perimeter(a):
return 4 * a
P = perimeter(r)
print("Периметр квадрата P = ", P)