Напишите (в очередной раз ☹) класс Square(x, y, w) со следующими свойствами:

   1 for x, y, w in (1, 2, 0), (1, 1, 7), (3, 4, 10), (5, 3, 6):
   2     Sq = Square(x, y, w)
   3     Sq.center += -1, -1
   4     match Sq:
   5         case Square(_, _, 0):
   6             print("Zero square")
   7         case Square(0, 0, _):
   8             print("Started from 0")
   9         case Square(s=100):
  10             print("10x10 square")
  11         case Square(center=c) if c[0] == round(c[0]) and c[1] == round(c[1]):
  12             print("Even-sized square")

Zero square
Started from 0
10x10 square
Even-sized square


CategoryHomework

LecturesCMC/PythonIntro2024/Homework_MatchSquare (последним исправлял пользователь FrBrGeorge 2024-12-06 16:23:51)