hnc-vitalii/HNS/Excercises/27.08.2023/main.py

18 lines
296 B
Python
Raw Permalink Normal View History

import json
from classes import Shapes
def json_to_python():
with open('shapes.json') as shapes:
data = json.load(shapes)
return data
obj = json_to_python()
for shape in obj['shapes']:
sh1 = Shape.create_shape(shape)
print(sh1.perimeter())
print(sh1.area())