{"id":11056,"date":"2022-06-13T01:40:46","date_gmt":"2022-06-12T22:40:46","guid":{"rendered":"https:\/\/elzero.org\/?p=11056"},"modified":"2022-06-13T01:41:41","modified_gmt":"2022-06-12T22:41:41","slug":"python-ternary-operator-use","status":"publish","type":"post","link":"https:\/\/elzero.org\/old\/python-ternary-operator-use\/","title":{"rendered":"\u0625\u0633\u062a\u062e\u062f\u0627\u0645 \u0627\u0644 Ternary Operator \u0641\u064a \u0627\u0644 Python"},"content":{"rendered":"<div class=\"text\">\r\n\u0627\u0644 Ternary Operator \u064a\u062c\u0639\u0644\u0643 \u062a\u0633\u062a\u062e\u062f\u0645 \u0627\u0644\u0634\u0631\u0637 \u0628\u0634\u0643\u0644 \u0645\u0628\u0633\u0637 \u0648\u0645\u062e\u062a\u0635\u0631\r\n<\/div>\r\n\r\n<h3>\u0627\u0644\u0634\u0631\u0637 \u0645\u0643\u062a\u0648\u0628 \u0628\u0627\u0644\u0637\u0631\u064a\u0642\u0629 \u0627\u0644\u0639\u0627\u062f\u064a\u0629<\/h3>\r\n\r\n<script type=\"text\/plain\" class=\"language-python\">\r\nage = 40\r\nif age > 20:\r\n  print(\"Suitable\")\r\nelse:\r\n  print(\"Not Suitable\")\r\n<\/script>\r\n\r\n<h3>\u0627\u0644\u0634\u0631\u0637 \u0628\u0627\u0644 Ternary Operator<\/h3>\r\n\r\n<script type=\"text\/plain\" class=\"language-python\">\r\nage = 40\r\nprint(\"Suitable\") if age > 20 else print(\"Not Suitable\")\r\n<\/script>\r\n\r\n<h3>\u0627\u0644 Syntax \u0643\u0627\u0644\u062a\u0627\u0644\u064a<\/h3>\r\n\r\n<script type=\"text\/plain\" class=\"language-python\">\r\nage = 40\r\n# [Result If Condition Is True] If [Condition] Else [Result If Condition Is False]\r\n<\/script>","protected":false},"excerpt":{"rendered":"<p>\u0627\u0644 Ternary Operator \u064a\u062c\u0639\u0644\u0643 \u062a\u0633\u062a\u062e\u062f\u0645 \u0627\u0644\u0634\u0631\u0637 \u0628\u0634\u0643\u0644 \u0645\u0628\u0633\u0637 \u0648\u0645\u062e\u062a\u0635\u0631<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[613],"tags":[107,800,798,451,458,797,459,27],"class_list":["post-11056","post","type-post","status-publish","format-standard","hentry","category-python-tutorials","tag-code","tag-condition","tag-operator","tag-programming","tag-python","tag-ternary","tag-459","tag-27"],"_links":{"self":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/11056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/comments?post=11056"}],"version-history":[{"count":3,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/11056\/revisions"}],"predecessor-version":[{"id":11059,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/11056\/revisions\/11059"}],"wp:attachment":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/media?parent=11056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/categories?post=11056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/tags?post=11056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}