Загружаю ДЗ по классам

This commit is contained in:
ehermakov 2023-08-21 20:18:16 +03:00
parent 98a5e3c233
commit 121e03958d
11 changed files with 148 additions and 0 deletions

View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
</module>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (13082023 ДЗ по фигурам JSON)" project-jdk-type="Python SDK" />
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/13082023 ДЗ по фигурам JSON.iml" filepath="$PROJECT_DIR$/.idea/13082023 ДЗ по фигурам JSON.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="27a86114-b1b9-4cc2-8048-1f6f3670758a" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../../.." />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2UIkG67KMayDECPY1goC5e7myvQ" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"last_opened_file_path": "/Users/DC/Documents/Обучение с Артуром/Git test/hnc-eduard/hnc-eduard/HNS/Excercises/13082023 ДЗ по фигурам JSON"
}
}]]></component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="27a86114-b1b9-4cc2-8048-1f6f3670758a" name="Changes" comment="" />
<created>1692634383712</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1692634383712</updated>
</task>
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
</project>

View File

@ -0,0 +1,14 @@
import math
from Shape import Shape
class Circle(Shape):
def __int__(self, radius, color):
self.radius = radius
self.color = color
def area(self):
return math.pi * (self.radius ** 2)
def perimetr(self):
return 2 * math.pi * self.radius

View File

@ -0,0 +1,14 @@
from Shape import Shape
class Rectangle(Shape):
def __int__(self, width, height, color):
self.width = width
self.height = height
self.color = color
def area(self):
return self.width * self.height
def perimetr(self):
return (self.width + self.height) * 2

View File

@ -0,0 +1,7 @@
class Shape:
def area(self):
return NotImplementedError("Необходимо переопределить метод area в дочернем классе")
def perimetr(self):
return NotImplementedError("Необходимо переопределить метод perimetr в дочернем классе")

View File

@ -0,0 +1,13 @@
from Shape import Shape
class Square(Shape):
def __int__(self, side, color):
self.side = side
self.color = color
def area(self):
return self.side ** 2
def perimetr(self):
return 4 * self.side