{"id":109686,"date":"2025-05-19T19:59:14","date_gmt":"2025-05-19T16:29:14","guid":{"rendered":"https:\/\/nabfollower.com\/blog\/%d9%85%d9%86-%d8%a8%d8%b1%d8%a7%db%8c-%d8%a7%db%8c%d8%ac%d8%a7%d8%af-%db%8c%da%a9-%d9%85%d8%a7%d8%b4%db%8c%d9%86-%d8%ad%d8%b3%d8%a7%d8%a8-%d8%b3%d8%a7%d8%af%d9%87-%d8%8c-%da%a9%d8%af-%d9%be%d8%a7\/"},"modified":"2025-05-19T19:59:14","modified_gmt":"2025-05-19T16:29:14","slug":"%d9%85%d9%86-%d8%a8%d8%b1%d8%a7%db%8c-%d8%a7%db%8c%d8%ac%d8%a7%d8%af-%db%8c%da%a9-%d9%85%d8%a7%d8%b4%db%8c%d9%86-%d8%ad%d8%b3%d8%a7%d8%a8-%d8%b3%d8%a7%d8%af%d9%87-%d8%8c-%da%a9%d8%af-%d9%be%d8%a7","status":"publish","type":"post","link":"https:\/\/nabfollower.com\/blog\/%d9%85%d9%86-%d8%a8%d8%b1%d8%a7%db%8c-%d8%a7%db%8c%d8%ac%d8%a7%d8%af-%db%8c%da%a9-%d9%85%d8%a7%d8%b4%db%8c%d9%86-%d8%ad%d8%b3%d8%a7%d8%a8-%d8%b3%d8%a7%d8%af%d9%87-%d8%8c-%da%a9%d8%af-%d9%be%d8%a7\/","title":{"rendered":"\u0645\u0646 \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u0645\u0627\u0634\u06cc\u0646 \u062d\u0633\u0627\u0628 \u0633\u0627\u062f\u0647 \u060c \u06a9\u062f \u067e\u0627\u06cc\u062a\u0648\u0646 \u067e\u06cc\u062f\u0627 \u06a9\u0631\u062f\u0645."},"content":{"rendered":"<div data-article-id=\"2503150\" id=\"article-body\">\n<p>\u0645\u0627\u0634\u06cc\u0646 \u062d\u0633\u0627\u0628 DEF ():<br \/>\u0686\u0627\u067e (&#8220;\u0628\u0647 \u0645\u0627\u0634\u06cc\u0646 \u062d\u0633\u0627\u0628 \u067e\u0627\u06cc\u062a\u0648\u0646 \u062e\u0648\u0634 \u0622\u0645\u062f\u06cc\u062f!&#8221;)<br \/>\u0686\u0627\u067e (&#8220;\u06cc\u06a9 \u0639\u0645\u0644\u06cc\u0627\u062a \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f:&#8221;)<br \/>\u0686\u0627\u067e (&#8220;1. \u0627\u0641\u0632\u0648\u062f\u0646\u06cc (+)&#8221;)<br \/>\u0686\u0627\u067e (&#8220;2. \u062a\u0641\u0631\u06cc\u0642 (-)&#8221;)<br \/>\u0686\u0627\u067e (&#8220;3. \u0636\u0631\u0628<br \/>&#8220;)<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code># Get user input for operation<br\/>operation = input(\"Enter the number corresponding to the operation (1\/2\/3\/4): \")\n\n<p>if operation not in ['1', '2', '3', '4']:<br\/>print(\"Invalid input. Please restart and choose a valid operation.\")<br\/>return<\/p>\n\n\n<p>try:<br\/>num1 = float(input(\"Enter the first number: \"))<br\/>num2 = float(input(\"Enter the second number: \"))<br\/>except ValueError:<br\/>print(\"Invalid input. Please enter numeric values.\")<br\/>return<\/p>\n\n\n<p>if operation == '1':<br\/>result = num1 + num2<br\/>print(f\"The result of {num1} + {num2} is {result}\")<br\/>elif operation == '2':<br\/>result = num1 - num2<br\/>print(f\"The result of {num1} - {num2} is {result}\")<br\/>elif operation == '3':<br\/>result = num1 * num2<br\/>print(f\"The result of {num1} * {num2} is {result}\")<br\/>elif operation == '4':<br\/>if num2 == 0:<br\/>print(\"Error: Division by zero is not allowed.\")<br\/>else:<br\/>result = num1 \/ num2<br\/>print(f\"The result of {num1} \/ {num2} is {result}\")<br\/><\/p><\/code><\/pre>\n<div class=\"highlight__panel js-actions-panel\">\n<div class=\"highlight__panel-action js-fullscreen-code-action\">\n    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"><title>\u0686\u0627\u067e (&#8220;4. \u0628\u062e\u0634 (\/)&#8221;)<\/title>\n    <path d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\/>\n<\/svg><\/p>\n<p>    <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"><title>\u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f<\/title>\n    <path d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\/>\n<\/svg><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>\u0627\u0632 \u062d\u0627\u0644\u062a \u062a\u0645\u0627\u0645 \u0635\u0641\u062d\u0647 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f<\/p>\n<\/p><\/div>\n<p>\u0645\u0627\u0634\u06cc\u0646 \u062d\u0633\u0627\u0628 ()<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0645\u0627\u0634\u06cc\u0646 \u062d\u0633\u0627\u0628 DEF ():\u0686\u0627\u067e (&#8220;\u0628\u0647 \u0645\u0627\u0634\u06cc\u0646 \u062d\u0633\u0627\u0628 \u067e\u0627\u06cc\u062a\u0648\u0646 \u062e\u0648\u0634 \u0622\u0645\u062f\u06cc\u062f!&#8221;)\u0686\u0627\u067e (&#8220;\u06cc\u06a9 \u0639\u0645\u0644\u06cc\u0627\u062a \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f:&#8221;)\u0686\u0627\u067e (&#8220;1. \u0627\u0641\u0632\u0648\u062f\u0646\u06cc (+)&#8221;)\u0686\u0627\u067e (&#8220;2. \u062a\u0641\u0631\u06cc\u0642 (-)&#8221;)\u0686\u0627\u067e (&#8220;3. \u0636\u0631\u0628&#8220;) # Get user input for operationoperation = input(&#8220;Enter the number corresponding to the operation (1\/2\/3\/4): &#8220;) if operation not in [&#8216;1&#8217;, &#8216;2&#8217;, &#8216;3&#8217;, &#8216;4&#8217;]:print(&#8220;Invalid input. Please restart and choose a valid operation.&#8221;)return &hellip;<\/p>\n","protected":false},"author":2,"featured_media":109687,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/media2.dev.to\/dynamic\/image\/width=1000,height=500,fit=cover,gravity=auto,format=auto\/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcx03u4npa8qvgfvdlvep.png","fifu_image_alt":"","footnotes":""},"categories":[339],"tags":[],"class_list":["post-109686","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/109686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/comments?post=109686"}],"version-history":[{"count":0,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/109686\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media\/109687"}],"wp:attachment":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media?parent=109686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/categories?post=109686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/tags?post=109686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}