{"id":1606,"date":"2011-05-05T21:37:55","date_gmt":"2011-05-05T20:37:55","guid":{"rendered":"http:\/\/www.codingfriends.com\/?p=1606"},"modified":"2011-05-05T21:37:55","modified_gmt":"2011-05-05T20:37:55","slug":"add-two-numbers-6","status":"publish","type":"post","link":"https:\/\/www.codingfriends.com\/index.php\/2011\/05\/05\/add-two-numbers-6\/","title":{"rendered":"Add two numbers"},"content":{"rendered":"<p>To carry on my normal process of notes on this website for different languages here is the how to add two numbers with a return value from a function.<\/p>\n<p>To define a function you use the &#8220;def&#8221; syntax within the programming language and then the next bit of text before the parameters for the function itself ( in this case the parameters are the (number1, number2) ), is the function name and how to call the function.  <\/p>\n<p>The function below takes two parameters and returns back there result of the mathematical addition, the last part is how to call the function.<\/p>\n<pre lang=\"python\">\r\ndef addTwo(number1, number2) : \r\n\treturn number1 + number2\r\n\r\nprint addTwo(1,2)\r\n<\/pre>\n<p>and the output would be<\/p>\n<pre lang=\"bash\">\r\n3\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To carry on my normal process of notes on this website for different languages here is the how to add two numbers with a return value from a function. To define a function you use the &#8220;def&#8221; syntax within the programming language and then the next bit of text before the parameters for the function &hellip; <a href=\"https:\/\/www.codingfriends.com\/index.php\/2011\/05\/05\/add-two-numbers-6\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Add two numbers<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[286],"tags":[346],"class_list":["post-1606","post","type-post","status-publish","format-standard","hentry","category-python","tag-add-two-numbers"],"_links":{"self":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/comments?post=1606"}],"version-history":[{"count":1,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1606\/revisions"}],"predecessor-version":[{"id":1607,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1606\/revisions\/1607"}],"wp:attachment":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/media?parent=1606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/categories?post=1606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/tags?post=1606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}