{"id":427422,"date":"2024-07-25T21:59:47","date_gmt":"2024-07-25T21:59:47","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=427422"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=427422","title":{"rendered":"<span>\u0421\u0435\u043a\u0440\u0435\u0442\u044b \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 Python<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0433\u0440\u0430\u044e\u0442 \u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438. \u041e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0412 Python \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f <strong>\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><code>not<\/code>\u00a0\u2014 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p><code>and<\/code>\u00a0\u2014 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p><code>or<\/code>\u00a0\u2014 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u0438 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 Python.<\/p>\n<h2>\u0422\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432<\/h2>\n<p>\u041c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code> \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0432\u043e\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>not<\/code>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"center\">a<\/p>\n<\/th>\n<th>\n<p align=\"center\">not a<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>and<\/code>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"center\">a<\/p>\n<\/th>\n<th>\n<p align=\"center\">b<\/p>\n<\/th>\n<th>\n<p align=\"center\">a and b<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>or<\/code>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"center\">a<\/p>\n<\/th>\n<th>\n<p align=\"center\">b<\/p>\n<\/th>\n<th>\n<p align=\"center\">a or b<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430\u043c\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b <code>True<\/code> \u0438 <code>False<\/code>, \u0440\u0430\u0431\u043e\u0442\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 Python \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(not True) print(not False) print(False and True) print(True and True) print(False or True) print(False or False)<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>False True False True True False<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e Python \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 <code>True<\/code> \u0438 <code>False<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u041e\u043f\u0435\u0440\u0430\u043d\u0434\u0430\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <code>not<\/code>, <code>and<\/code> \u0438 <code>or<\/code> \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b <strong>\u043b\u044e\u0431\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>. <\/p>\n<h2>\u041f\u043e\u043d\u044f\u0442\u0438\u044f truthy \u0438 falsy<\/h2>\n<p>\u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u044f\u0437\u044b\u043a\u0430 Python \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f <code>truthy<\/code> \u0438 <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041b\u044e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 Python \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0446\u0435\u043d\u0435\u043d \u043a\u0430\u043a <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a <code>True<\/code>, \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f <code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a <code>False<\/code> \u2014 <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<p>\u041a \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>False<\/code> <\/p>\n<\/li>\n<li>\n<p>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>None<\/code><\/p>\n<\/li>\n<li>\n<p>\u043d\u0443\u043b\u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445: <code>0<\/code>, <code>0.0<\/code>, <code>0j<\/code>, <code>Decimal(0)<\/code>, <code>Fraction(0, 1)<\/code><\/p>\n<\/li>\n<li>\n<p>\u043f\u0443\u0441\u0442\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438: <code>''<\/code>, <code>()<\/code>, <code>[]<\/code>, <code>{}<\/code>, <code>set()<\/code>, <code>range(0)<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a <code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c. \u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f <code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438<strong> <\/strong>\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>bool()<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\"># falsy \u043e\u0431\u044a\u0435\u043a\u0442\u044b print(bool(False)) print(bool(None)) print(bool(0)) print(bool(0.0)) print(bool([])) print(bool('')) print(bool({}))  #truthy \u043e\u0431\u044a\u0435\u043a\u0442\u044b print(bool(True)) print(bool(123)) print(bool(69.96)) print(bool('beegeek')) print(bool([4, 8, 15, 16, 23, 42])) print(bool({1, 2, 3}))<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>False False False False False False False True True True True True True<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f <code>truthy<\/code> \u0438 <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 Python \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0432 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u043d\u0435\u0440\u0435.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">if len(data) &gt; 0:     ...  if value == True:     ...  if value == False:     ...  <\/code><\/pre>\n<p>\u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435:<\/p>\n<pre><code class=\"python\">if data:     ...    if value:     ...    if not value:     ...<\/code><\/pre>\n<p>\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 Python \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 <code>truthy<\/code> \u0438 <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/87c\/910\/ffd\/87c910ffdb5dd5194707007860f2a88e.png\" width=\"1212\" height=\"167\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87c\/910\/ffd\/87c910ffdb5dd5194707007860f2a88e.png\"\/><\/figure>\n<h2>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 not<\/h2>\n<p>\u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c, \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>not<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u0415\u0441\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043e\u0442\u043b\u0438\u0447\u0435\u043d \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <code>True<\/code> \u0438 <code>False<\/code>, \u043e\u043d \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 <code>truthy<\/code> \u0438 <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>not<\/code> <strong>\u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f<\/strong> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(not False) print(not None) print(not 0) print(not 0.0) print(not []) print(not '') print(not {})<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>True True True True True True True<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(not True) print(not 123) print(not 69.96) print(not 'beegeek') print(not [4, 8, 15, 16, 23, 42]) print(not {1, 2, 3})<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>False False False False False False<\/code><\/pre>\n<h2>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b and \u0438 or<\/h2>\n<p>\u041e\u043f\u0435\u0440\u0430\u043d\u0434\u0430\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <code>and<\/code> \u0438 <code>or<\/code>, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 <code>not<\/code>, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043b\u044e\u0431\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <code>not<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <code>and<\/code> \u0438 <code>or<\/code> \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u00a0<strong>\u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0432\u043e\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432<\/strong>. \u041a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(None or 0) print(0 or 5) print('beegeek' or None) print([1, 2, 3] or [6, 9])  print(1 or 'beegeek' or None) print(0.0 or 'habr' or {'one': 1}) print(0 or '' or [6, 9]) print(0 or '' or []) print(0 or '' or [] or {})<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>0 5 beegeek [1, 2, 3] 1 habr [6, 9] [] {}<\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>or<\/code> \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0432\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043a\u0430\u043a <code>truthy<\/code> \u0438\u043b\u0438 <code>falsy<\/code>\u043e\u0431\u044a\u0435\u043a\u0442, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code>, \u0430 \u0441\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443 \u2014 <strong>\u043f\u0435\u0440\u0432\u044b\u0439\u00a0<\/strong><code>truthy<\/code><strong> \u043e\u0431\u044a\u0435\u043a\u0442 \u043b\u0438\u0431\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0435\u0441\u043b\u0438\u00a0<\/strong><code>truthy<\/code><strong>\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b.<\/strong><\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u0435\u043b\u043e \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <code>and<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(None and 10) print(5 and 0.0) print('beegeek' and {}) print([1, 2, 3] and [6, 9])  print(1 and 'beegeek' and None) print('habr' and 0 and {'one': 1}) print(10 and [6, 9] and [])<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>None 0.0 {} [6, 9] None 0 []<\/code><\/pre>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u00a0<code>and<\/code>\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <strong>\u043f\u0435\u0440\u0432\u044b\u0439\u00a0<\/strong><code>falsy<\/code><strong> \u043e\u0431\u044a\u0435\u043a\u0442 \u043b\u0438\u0431\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0435\u0441\u043b\u0438\u00a0<\/strong><code>falsy<\/code><strong> \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b.<\/strong><\/p>\n<h2>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043b\u0435\u043d\u0438\u0432\u044b<\/h2>\n<p>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432 Python \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f <strong>\u043b\u0435\u043d\u0438\u0432\u044b\u043c\u0438<\/strong>. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u043e\u0446\u0435\u043d\u043a\u0438 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 <strong>\u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e<\/strong> \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u044d\u0442\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u00a0\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u00a0<code>or<\/code>\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u0442\u043e \u043e\u0431\u0449\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>True<\/code>, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u00a0<code>and<\/code>\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u0442\u043e \u043e\u0431\u0449\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>False<\/code>, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u00a0\u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u0435<\/strong>\u00a0(short-circuit evaluation) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">def f():     print('bee')     return 3    if True or f():     print('geek')<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>geek<\/code><\/pre>\n<p>\u041b\u0435\u0432\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>or<\/code>\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>), \u0437\u043d\u0430\u0447\u0438\u0442, \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <strong>\u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c<\/strong> \u043f\u0440\u0430\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>f()<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0430 <code>bee<\/code>. \u041e\u0431\u0449\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0431\u043b\u043e\u043a\u0430 \u043a\u043e\u0434\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u0438 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <code>geek<\/code>.<\/p>\n<p>\u041d\u0430\u043f\u0440\u043e\u0442\u0438\u0432, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">def f():     print('bee')     return 3    if True and f():     print('geek')<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>bee geek<\/code><\/pre>\n<p>\u041b\u0435\u0432\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>and<\/code>\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>), \u0437\u043d\u0430\u0447\u0438\u0442, \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <strong>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c<\/strong> \u0438 \u043f\u0440\u0430\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>f()<\/code>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438\u0437 \u0442\u0435\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <code>bee<\/code>. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e <code>3<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0431\u0449\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u043b\u043e <code>3<\/code>, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0431\u043b\u043e\u043a\u0430 \u043a\u043e\u0434\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u0438 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <code>geek<\/code>.<\/p>\n<h3>\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432<\/h3>\n<p>\u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u041d\u0438\u0436\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 (\u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437):<\/p>\n<ol>\n<li>\n<p><code>not<\/code><\/p>\n<\/li>\n<li>\n<p><code>and<\/code><\/p>\n<\/li>\n<li>\n<p><code>or<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0443 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">a = 0 b = 7 c = 10 print(not a and b or not c)        # 7<\/code><\/pre>\n<p>\u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:<\/p>\n<pre><code class=\"python\">a = 0 b = 7 c = 10 print(((not a) and b) or (not c))  # 7<\/code><\/pre>\n<p>\u041f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c Python (\u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f <code>=<\/code>) <strong>\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0437\u043a\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442<\/strong>. <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">a = 5 b = 7 print(not a == b)  # True<\/code><\/pre>\n<p>\u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:<\/p>\n<pre><code class=\"python\">a = 5 b = 7 print(not (a == b))  # True<\/code><\/pre>\n<p>\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0438\u0434\u0430:<\/p>\n<pre><code class=\"python\">a = 5 b = 7 print(a == not b)<\/code><\/pre>\n<p>\u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0432\u043e\u0437\u0431\u0443\u0436\u0434\u0435\u043d\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <code>SyntaxError<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(not 1 == 2 or 3 == 3 and 5 == 6)  <\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>True<\/code><\/pre>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>1 == 2<\/code>, <code>3 == 3<\/code> \u0438 <code>5 == 6<\/code>, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0438\u0434 <code>not False or True and False<\/code>. \u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>not<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>, \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e \u2014 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>and<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>False<\/code>. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0438\u0434 <code>True or False<\/code>. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>or<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u043e\u0431\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>. <\/p>\n<h2>\u0426\u0435\u043f\u043e\u0447\u043a\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439<\/h2>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432\u00a0<strong>\u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439<\/strong>.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">a = 5 b = 10 c = 15  print(a &lt; b &lt; c)        # True     print(a &lt; b and b &lt; c)  # True<\/code><\/pre>\n<p>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u00a0<code>a &lt; b &lt; c<\/code>\u00a0\u0438\u00a0<code>a &lt; b and b &lt; c<\/code>\u00a0\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 <strong>\u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0439 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b<\/strong> \u0437\u0430\u043f\u0438\u0441\u0438 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u043c\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u043b\u044f\u00a0\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438\u00a0<code>a &lt; b &lt; c<\/code>\u00a0\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u00a0<code>and<\/code>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f\u00a0<strong>\u043d\u0435\u044f\u0432\u043d\u043e<\/strong>.\u00a0<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u00a0<code>and<\/code>\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u00a0\u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u0435, \u0432\u0441\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0435\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u0432\u0435\u0440\u043d\u0443\u0432\u0448\u0435\u0433\u043e \u043b\u043e\u0436\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f, \u0438 \u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u044b \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">def f():     print('bee')     return 3  if 5 &lt; 1 &lt; f():     print('geek') else:     print('beegeek')<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>beegeek<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>5 &lt; 1 &lt; f()<\/code> \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e <code>5 &lt; 1 and 1 &lt; f()<\/code>. \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u00a0<code>5 &lt; 1<\/code>\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u00a0<code>False<\/code>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u00a0<code>1 &lt; f()<\/code>\u00a0\u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<code>f()<\/code>\u00a0\u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u043c \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0446\u0435\u043f\u043e\u0447\u0435\u043a \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">def f():     print('bee')     return 3  if 1 &lt; f() &lt; 5:     print('geek')<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>bee geek<\/code><\/pre>\n<p>\u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">def f():     print('bee')     return 3  if 1 &lt; f() and f() &lt; 5:     print('geek')<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>bee bee geek<\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0432 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438\u00a0<code>1 &lt; f() &lt; 5<\/code>\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<code>f()<\/code>\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0430 \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438\u00a0<code>1 &lt; f() and f() &lt; 5<\/code>\u00a0\u2014 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430. \u0414\u0430\u043d\u043d\u0443\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u043d\u0434, \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">from random import randint  def f():     x = randint(1, 7)     print(x)     return x  print(1 &lt; f() &lt; 5) print(1 &lt; f() and f() &lt; 5)<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442 (\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f):<\/p>\n<pre><code>4 True 7 5 False<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u0432 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<code>f()<\/code>\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00a0<code>4<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<code>f()<\/code>\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (<code>7<\/code>\u00a0\u0438\u00a0<code>5<\/code>).\u00a0\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u00a0<code>1 &lt; f() &lt; 5<\/code>\u00a0\u0438\u00a0<code>1 &lt; f() and f() &lt; 5<\/code>\u00a0\u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u043c\u0438.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c\u0441\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b Python. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f <strong>\u0441 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c<\/strong> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u0437-\u0437\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0433\u043e \u043d\u0435\u044f\u0432\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>and<\/code>.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">lst = [1, 2, 3] num = 2  print(num in lst == True)<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>False<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>num in lst == True<\/code> \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e <code>num in lst and lst == True<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e <code>True and False<\/code>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0434\u0430\u043d\u043d\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>False<\/code>.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0435 \u0434\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">a = 5 b = 5 c = 10  print(a &lt; c is True)         print(a == b in [True])<\/code><\/pre>\n<p>\u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u043a\u043e\u0434\u0443:<\/p>\n<pre><code class=\"python\">a = 5 b = 5 c = 10  print(a &lt; c and c is True) print(a == b and b in [True])<\/code><\/pre>\n<p>\u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>False False<\/code><\/pre>\n<h2>\u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u0438\u0442\u043e\u0433\u0438<\/h2>\n<p>\u041f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435.<\/p>\n<p>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b\u00a0<code>and<\/code>\u00a0\u0438\u00a0<code>or<\/code>\u00a0\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0435\u043d\u0438\u0432\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438. \u041e\u043d\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0432\u043e\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u0435. \u0412 \u0446\u0435\u043f\u043e\u0447\u043a\u0430\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u00a0<code>and<\/code>\u00a0\u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u044f\u0432\u043d\u043e. \u041e\u0431 \u044d\u0442\u043e\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443\u00a0<a href=\"https:\/\/t.me\/pygen_ru\" rel=\"noopener noreferrer nofollow\">\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b\u0443<\/a>, \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e!<\/p>\n<p>\u2764\ufe0f Happy Pythoning! ?<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/824170\/\"> https:\/\/habr.com\/ru\/articles\/824170\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0433\u0440\u0430\u044e\u0442 \u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438. \u041e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0412 Python \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f <strong>\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p><code>not<\/code>\u00a0\u2014 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p><code>and<\/code>\u00a0\u2014 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p><code>or<\/code>\u00a0\u2014 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u0438 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 Python.<\/p>\n<h2>\u0422\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432<\/h2>\n<p>\u041c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code> \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0432\u043e\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>not<\/code>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"center\">a<\/p>\n<\/th>\n<th>\n<p align=\"center\">not a<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>and<\/code>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"center\">a<\/p>\n<\/th>\n<th>\n<p align=\"center\">b<\/p>\n<\/th>\n<th>\n<p align=\"center\">a and b<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>or<\/code>:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"center\">a<\/p>\n<\/th>\n<th>\n<p align=\"center\">b<\/p>\n<\/th>\n<th>\n<p align=\"center\">a or b<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>False<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>True<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430\u043c\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b <code>True<\/code> \u0438 <code>False<\/code>, \u0440\u0430\u0431\u043e\u0442\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 Python \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(not True) print(not False) print(False and True) print(True and True) print(False or True) print(False or False)<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>False True False True True False<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e Python \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 <code>True<\/code> \u0438 <code>False<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u041e\u043f\u0435\u0440\u0430\u043d\u0434\u0430\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <code>not<\/code>, <code>and<\/code> \u0438 <code>or<\/code> \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b <strong>\u043b\u044e\u0431\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>. <\/p>\n<h2>\u041f\u043e\u043d\u044f\u0442\u0438\u044f truthy \u0438 falsy<\/h2>\n<p>\u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u044f\u0437\u044b\u043a\u0430 Python \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f <code>truthy<\/code> \u0438 <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041b\u044e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 Python \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0446\u0435\u043d\u0435\u043d \u043a\u0430\u043a <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a <code>True<\/code>, \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f <code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a <code>False<\/code> \u2014 <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<p>\u041a \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>False<\/code> <\/p>\n<\/li>\n<li>\n<p>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>None<\/code><\/p>\n<\/li>\n<li>\n<p>\u043d\u0443\u043b\u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445: <code>0<\/code>, <code>0.0<\/code>, <code>0j<\/code>, <code>Decimal(0)<\/code>, <code>Fraction(0, 1)<\/code><\/p>\n<\/li>\n<li>\n<p>\u043f\u0443\u0441\u0442\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438: <code>''<\/code>, <code>()<\/code>, <code>[]<\/code>, <code>{}<\/code>, <code>set()<\/code>, <code>range(0)<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a <code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c. \u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f <code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438<strong> <\/strong>\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>bool()<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\"># falsy \u043e\u0431\u044a\u0435\u043a\u0442\u044b print(bool(False)) print(bool(None)) print(bool(0)) print(bool(0.0)) print(bool([])) print(bool('')) print(bool({}))  #truthy \u043e\u0431\u044a\u0435\u043a\u0442\u044b print(bool(True)) print(bool(123)) print(bool(69.96)) print(bool('beegeek')) print(bool([4, 8, 15, 16, 23, 42])) print(bool({1, 2, 3}))<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>False False False False False False False True True True True True True<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f <code>truthy<\/code> \u0438 <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 Python \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0432 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u043d\u0435\u0440\u0435.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">if len(data) &gt; 0:     ...  if value == True:     ...  if value == False:     ...  <\/code><\/pre>\n<p>\u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435:<\/p>\n<pre><code class=\"python\">if data:     ...    if value:     ...    if not value:     ...<\/code><\/pre>\n<p>\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 Python \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 <code>truthy<\/code> \u0438 <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 not<\/h2>\n<p>\u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c, \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>not<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u0415\u0441\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043e\u0442\u043b\u0438\u0447\u0435\u043d \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <code>True<\/code> \u0438 <code>False<\/code>, \u043e\u043d \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 <code>truthy<\/code> \u0438 <code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>not<\/code> <strong>\u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f<\/strong> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(not False) print(not None) print(not 0) print(not 0.0) print(not []) print(not '') print(not {})<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>True True True True True True True<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(not True) print(not 123) print(not 69.96) print(not 'beegeek') print(not [4, 8, 15, 16, 23, 42]) print(not {1, 2, 3})<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>False False False False False False<\/code><\/pre>\n<h2>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b and \u0438 or<\/h2>\n<p>\u041e\u043f\u0435\u0440\u0430\u043d\u0434\u0430\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <code>and<\/code> \u0438 <code>or<\/code>, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 <code>not<\/code>, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043b\u044e\u0431\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <code>not<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <code>and<\/code> \u0438 <code>or<\/code> \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code>. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u00a0<strong>\u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0432\u043e\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432<\/strong>. \u041a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(None or 0) print(0 or 5) print('beegeek' or None) print([1, 2, 3] or [6, 9])  print(1 or 'beegeek' or None) print(0.0 or 'habr' or {'one': 1}) print(0 or '' or [6, 9]) print(0 or '' or []) print(0 or '' or [] or {})<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>0 5 beegeek [1, 2, 3] 1 habr [6, 9] [] {}<\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>or<\/code> \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0432\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043a\u0430\u043a <code>truthy<\/code> \u0438\u043b\u0438 <code>falsy<\/code>\u043e\u0431\u044a\u0435\u043a\u0442, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code> \u0438\u043b\u0438 <code>False<\/code>, \u0430 \u0441\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443 \u2014 <strong>\u043f\u0435\u0440\u0432\u044b\u0439\u00a0<\/strong><code>truthy<\/code><strong> \u043e\u0431\u044a\u0435\u043a\u0442 \u043b\u0438\u0431\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0435\u0441\u043b\u0438\u00a0<\/strong><code>truthy<\/code><strong>\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b.<\/strong><\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u0435\u043b\u043e \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <code>and<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(None and 10) print(5 and 0.0) print('beegeek' and {}) print([1, 2, 3] and [6, 9])  print(1 and 'beegeek' and None) print('habr' and 0 and {'one': 1}) print(10 and [6, 9] and [])<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>None 0.0 {} [6, 9] None 0 []<\/code><\/pre>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u00a0<code>and<\/code>\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <strong>\u043f\u0435\u0440\u0432\u044b\u0439\u00a0<\/strong><code>falsy<\/code><strong> \u043e\u0431\u044a\u0435\u043a\u0442 \u043b\u0438\u0431\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0435\u0441\u043b\u0438\u00a0<\/strong><code>falsy<\/code><strong> \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b.<\/strong><\/p>\n<h2>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043b\u0435\u043d\u0438\u0432\u044b<\/h2>\n<p>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432 Python \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f <strong>\u043b\u0435\u043d\u0438\u0432\u044b\u043c\u0438<\/strong>. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u043e\u0446\u0435\u043d\u043a\u0438 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 <strong>\u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e<\/strong> \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u044d\u0442\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u00a0\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u00a0<code>or<\/code>\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u0442\u043e \u043e\u0431\u0449\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>True<\/code>, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u00a0<code>and<\/code>\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>falsy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u0442\u043e \u043e\u0431\u0449\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>False<\/code>, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u00a0\u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u0435<\/strong>\u00a0(short-circuit evaluation) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">def f():     print('bee')     return 3    if True or f():     print('geek')<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>geek<\/code><\/pre>\n<p>\u041b\u0435\u0432\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>or<\/code>\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>), \u0437\u043d\u0430\u0447\u0438\u0442, \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <strong>\u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c<\/strong> \u043f\u0440\u0430\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>f()<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0430 <code>bee<\/code>. \u041e\u0431\u0449\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0431\u043b\u043e\u043a\u0430 \u043a\u043e\u0434\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u0438 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <code>geek<\/code>.<\/p>\n<p>\u041d\u0430\u043f\u0440\u043e\u0442\u0438\u0432, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">def f():     print('bee')     return 3    if True and f():     print('geek')<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>bee geek<\/code><\/pre>\n<p>\u041b\u0435\u0432\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>and<\/code>\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>), \u0437\u043d\u0430\u0447\u0438\u0442, \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <strong>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c<\/strong> \u0438 \u043f\u0440\u0430\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>f()<\/code>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438\u0437 \u0442\u0435\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <code>bee<\/code>. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e <code>3<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>truthy<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0431\u0449\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u043b\u043e <code>3<\/code>, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0431\u043b\u043e\u043a\u0430 \u043a\u043e\u0434\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u0438 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <code>geek<\/code>.<\/p>\n<h3>\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432<\/h3>\n<p>\u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u041d\u0438\u0436\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 (\u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437):<\/p>\n<ol>\n<li>\n<p><code>not<\/code><\/p>\n<\/li>\n<li>\n<p><code>and<\/code><\/p>\n<\/li>\n<li>\n<p><code>or<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0443 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">a = 0 b = 7 c = 10 print(not a and b or not c)        # 7<\/code><\/pre>\n<p>\u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:<\/p>\n<pre><code class=\"python\">a = 0 b = 7 c = 10 print(((not a) and b) or (not c))  # 7<\/code><\/pre>\n<p>\u041f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c Python (\u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f <code>=<\/code>) <strong>\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0437\u043a\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442<\/strong>. <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">a = 5 b = 7 print(not a == b)  # True<\/code><\/pre>\n<p>\u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:<\/p>\n<pre><code class=\"python\">a = 5 b = 7 print(not (a == b))  # True<\/code><\/pre>\n<p>\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0438\u0434\u0430:<\/p>\n<pre><code class=\"python\">a = 5 b = 7 print(a == not b)<\/code><\/pre>\n<p>\u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0432\u043e\u0437\u0431\u0443\u0436\u0434\u0435\u043d\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <code>SyntaxError<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">print(not 1 == 2 or 3 == 3 and 5 == 6)  <\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>True<\/code><\/pre>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>1 == 2<\/code>, <code>3 == 3<\/code> \u0438 <code>5 == 6<\/code>, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0438\u0434 <code>not False or True and False<\/code>. \u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>not<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>, \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e \u2014 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>and<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>False<\/code>. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0438\u0434 <code>True or False<\/code>. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>or<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u043e\u0431\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>True<\/code>. <\/p>\n<h2>\u0426\u0435\u043f\u043e\u0447\u043a\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439<\/h2>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432\u00a0<strong>\u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439<\/strong>.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">a = 5 b = 10 c = 15  print(a &lt; b &lt; c)        # True     print(a &lt; b and b &lt; c)  # True<\/code><\/pre>\n<p>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u00a0<code>a &lt; b &lt; c<\/code>\u00a0\u0438\u00a0<code>a &lt; b and b &lt; c<\/code>\u00a0\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 <strong>\u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0439 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b<\/strong> \u0437\u0430\u043f\u0438\u0441\u0438 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u043c\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0434\u043b\u044f\u00a0\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438\u00a0<code>a &lt; b &lt; c<\/code>\u00a0\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u00a0<code>and<\/code>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f\u00a0<strong>\u043d\u0435\u044f\u0432\u043d\u043e<\/strong>.\u00a0<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u00a0<code>and<\/code>\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u00a0\u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u0435, \u0432\u0441\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0435\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u0432\u0435\u0440\u043d\u0443\u0432\u0448\u0435\u0433\u043e \u043b\u043e\u0436\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f, \u0438 \u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u044b \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">def f():     print('bee')     return 3  if 5 &lt; 1 &lt; f():     print('geek') else:     print('beegeek')<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>beegeek<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>5 &lt; 1 &lt; f()<\/code> \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e <code>5 &lt; 1 and 1 &lt; f()<\/code>. \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u00a0<code>5 &lt; 1<\/code>\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u00a0<code>False<\/code>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u00a0<code>1 &lt; f()<\/code>\u00a0\u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<code>f()<\/code>\u00a0\u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u043c \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0446\u0435\u043f\u043e\u0447\u0435\u043a \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">def f():     print('bee')     return 3  if 1 &lt; f() &lt; 5:     print('geek')<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>bee geek<\/code><\/pre>\n<p>\u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">def f():     print('bee')     return 3  if 1 &lt; f() and f() &lt; 5:     print('geek')<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre><code>bee bee geek<\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0432 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438\u00a0<code>1 &lt; f() &lt; 5<\/code>\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<code>f()<\/code>\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0430 \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438\u00a0<code>1 &lt; f() and f() &lt; 5<\/code>\u00a0\u2014 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430. \u0414\u0430\u043d\u043d\u0443\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u043d\u0434, \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">from random import randint  def f():     x = randint(1, 7)     print(x)     return x  print(1 &lt; f() &lt; 5) print(1 &lt; f() and f() &lt; 5)<\/code><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434\u0438\u0442 (\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f):<\/p>\n<pre><code>4 True 7 5 False<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-427422","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/427422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=427422"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/427422\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=427422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=427422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=427422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}