diff --git a/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/.name b/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/.name new file mode 100644 index 0000000..11a5d8e --- /dev/null +++ b/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/.name @@ -0,0 +1 @@ +main.py \ No newline at end of file diff --git a/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/13082023 ДЗ по фигурам JSON.iml b/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/13082023 ДЗ по фигурам JSON.iml index 95aecb4..a293491 100644 --- a/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/13082023 ДЗ по фигурам JSON.iml +++ b/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/13082023 ДЗ по фигурам JSON.iml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/misc.xml b/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/misc.xml index 9ed1625..0f77601 100644 --- a/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/misc.xml +++ b/HNS/Excercises/13082023 ДЗ по фигурам JSON/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/HNS/Excercises/13082023 ДЗ по фигурам JSON/main.py b/HNS/Excercises/13082023 ДЗ по фигурам JSON/main.py index a73f17e..28afee8 100755 --- a/HNS/Excercises/13082023 ДЗ по фигурам JSON/main.py +++ b/HNS/Excercises/13082023 ДЗ по фигурам JSON/main.py @@ -31,19 +31,24 @@ def create_shape(json): def generate_shape(): + max_length = 100 types = ['square', 'circle', 'rectangle'] - rnd = random.randint(0, len(types) - 1) - shape_type = types[rnd] + colors = ['red', 'green', 'blue', 'yellow', 'black', 'white'] + + type_index = random.randint(0, len(types) - 1) + shape_type = types[type_index] + if shape_type == 'circle': - obj = Circle(rnd) + obj = Circle(random.randint(1, max_length)) elif shape_type == 'square': - obj = Square(rnd) + obj = Square(random.randint(1, max_length)) elif shape_type == 'rectangle': - obj = Rectangle(rnd, rnd) + obj = Rectangle(random.randint(1, 100), random.randint(1, max_length)) else: raise TypeError(f'Происходит что-то непонятное') - obj.color = 'unknown' - return obj + + color_index = random.randint(0, len(colors) - 1) + obj.color = colors[color_index] def json_to_python(filename): diff --git a/HNS/Excercises/26092023 КДА/Кофемашина.xlsx b/HNS/Excercises/26092023 КДА/Кофемашина.xlsx new file mode 100644 index 0000000..f0dcb2f Binary files /dev/null and b/HNS/Excercises/26092023 КДА/Кофемашина.xlsx differ