{"id":1468,"date":"2023-04-28T07:18:05","date_gmt":"2023-04-28T07:18:05","guid":{"rendered":"https:\/\/goldenoriole.in\/?page_id=1468"},"modified":"2023-04-28T07:18:05","modified_gmt":"2023-04-28T07:18:05","slug":"calculator","status":"publish","type":"page","link":"https:\/\/goldenoriole.in\/index.php\/calculator\/","title":{"rendered":"Calculator"},"content":{"rendered":"<p>[dm_code_snippet background=&#8221;yes&#8221; background-mobile=&#8221;yes&#8221; slim=&#8221;no&#8221; line-numbers=&#8221;no&#8221; bg-color=&#8221;#abb8c3&#8243; theme=&#8221;dark&#8221; language=&#8221;php&#8221; wrapped=&#8221;no&#8221; height=&#8221;&#8221; copy-text=&#8221;Copy Code&#8221; copy-confirmed=&#8221;Copied&#8221;]<\/p>\n<pre class=\"dm-pre-admin-side\"># define functions for addition, subtraction, multiplication, and division\r\ndef add(num1, num2):\r\n    return num1 + num2\r\n\r\ndef subtract(num1, num2):\r\n    return num1 - num2\r\n\r\ndef multiply(num1, num2):\r\n    return num1 * num2\r\n\r\ndef divide(num1, num2):\r\n    return num1 \/ num2\r\n\r\n# take user input for operation choice and two numbers\r\noperation = input(\"Enter an operation (+, -, *, \/): \")\r\nnum1 = float(input(\"Enter the first number: \"))\r\nnum2 = float(input(\"Enter the second number: \"))\r\n\r\n# perform the selected operation\r\nif operation == '+':\r\n    result = add(num1, num2)\r\nelif operation == '-':\r\n    result = subtract(num1, num2)\r\nelif operation == '*':\r\n    result = multiply(num1, num2)\r\nelif operation == '\/':\r\n    result = divide(num1, num2)\r\nelse:\r\n    print(\"Invalid operation\")\r\n\r\n# output the result\r\nprint(\"Result: \", result)\r\n<\/pre>\n<p>[\/dm_code_snippet]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[dm_code_snippet background=&#8221;yes&#8221; background-mobile=&#8221;yes&#8221; slim=&#8221;no&#8221; line-numbers=&#8221;no&#8221; bg-color=&#8221;#abb8c3&#8243; theme=&#8221;dark&#8221; language=&#8221;php&#8221; wrapped=&#8221;no&#8221; height=&#8221;&#8221; copy-text=&#8221;Copy Code&#8221; copy-confirmed=&#8221;Copied&#8221;] # define functions for addition, subtraction, multiplication, and division def add(num1, num2): return num1 + num2 def subtract(num1, num2): return num1 &#8211; num2 def multiply(num1, num2): return num1 * num2 def divide(num1, num2): return num1 \/ num2 # take user input for [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-1468","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/goldenoriole.in\/index.php\/wp-json\/wp\/v2\/pages\/1468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/goldenoriole.in\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/goldenoriole.in\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/goldenoriole.in\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/goldenoriole.in\/index.php\/wp-json\/wp\/v2\/comments?post=1468"}],"version-history":[{"count":1,"href":"https:\/\/goldenoriole.in\/index.php\/wp-json\/wp\/v2\/pages\/1468\/revisions"}],"predecessor-version":[{"id":1469,"href":"https:\/\/goldenoriole.in\/index.php\/wp-json\/wp\/v2\/pages\/1468\/revisions\/1469"}],"wp:attachment":[{"href":"https:\/\/goldenoriole.in\/index.php\/wp-json\/wp\/v2\/media?parent=1468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}