pass<\/strong>\n cass Class1:\n ...\n case host == 'localhost'\n ...<\/pre>\n\n\n\n\u0422\u0430\u043a\u0436\u0435 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a:In [ ]:<\/p>\n\n\n\n
def<\/strong> http_error(status):\n match status:\n case 400:\n return<\/strong> \"Bad request\"\n case 404:\n return<\/strong> \"Not found\"\n case 418:\n return<\/strong> \"I'm a teapot\"\n case _:\n return<\/strong> \"Something's wrong with the Internet\"<\/pre>\n\n\n\n\u042d\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 «\u0433\u0440\u043e\u043c\u043a\u0438\u0445» \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Python \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u043a\u043e\u043c\u043c\u044c\u044e\u043d\u0438\u0442\u0438.<\/p>\n\n\n\n
<\/span>\u0411\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Union \u0434\u043b\u044f \u0442\u0438\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/span><\/h2>\n\n\n\n\u0415\u0441\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u0447\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Union, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 typing:In [ ]:<\/p>\n\n\n\n
from<\/strong> typing<\/strong> import<\/strong> Union\n\ndef<\/strong> square(number: Union[int, float]) -> Union[int, float]:\n return<\/strong> number ** 2<\/pre>\n\n\n\n\u0422\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Python 3.10 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c pipe | \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0430:In [ ]:<\/p>\n\n\n\n
def<\/strong> square(number: int | float) -> int | float:\n return<\/strong> number ** 2<\/pre>\n\n\n\n<\/span>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b<\/span><\/h2>\n\n\n\n\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u043c\u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430\u043c\u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u0441\u044f, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043c with<\/code>, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0438\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430:In [ ]:<\/p>\n\n\n\nwith<\/strong> (\n CtxManager1(),\n CtxManager2()\n):\n ...\n\nwith<\/strong> (CtxManager1() as<\/strong> example,\n CtxManager2()):\n ...\n\nwith<\/strong> (\n CtxManager1() as<\/strong> example1,\n CtxManager2() as<\/strong> example2\n):\n ...<\/pre>\n\n\n\n<\/span>\u0411\u043e\u043b\u0435\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445<\/span><\/h2>\n\n\n\n\u041d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043e\u0431\u0449\u0435\u0435 \u0438 \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u043e\u0448\u0438\u0431\u043a\u0443 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u0412 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0438 Python core-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0438 \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c\u0438:In [ ]:<\/p>\n\n\n\n
expected = {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4,\n ^\nSyntaxError<\/strong>: '{' was never closed<\/pre>\n\n\n\nIn [ ]:<\/p>\n\n\n\n
>>> if<\/strong> rocket.position > event_horizon\n File \"<stdin>\", line 1\n if<\/strong> rocket.position > event_horizon\n ^\nSyntaxError<\/strong>: expected ':'<\/pre>\n\n\n\nIn [ ]:<\/p>\n\n\n\n
>>> {x,y for<\/strong> x,y in<\/strong> range(100)}\n File \"<stdin>\", line 1\n {x,y for<\/strong> x,y