{"id":1311,"date":"2020-04-17T14:04:20","date_gmt":"2020-04-17T21:04:20","guid":{"rendered":"https:\/\/renanmf.com\/?p=1311"},"modified":"2020-12-29T10:24:10","modified_gmt":"2020-12-29T13:24:10","slug":"functions-python","status":"publish","type":"post","link":"https:\/\/renanmf.com\/functions-python\/","title":{"rendered":"Functions in Python"},"content":{"rendered":"<p>As the code grows the complexity also grows, functions help organizing the code.<\/p>\n<p>Functions are a handy way to create blocks of code that you can reuse.<\/p>\n<h2>Definition and Calling<\/h2>\n<p>In Python use the <code>def<\/code> keyword to define a function.<\/p>\n<p>Give it a name and use parentheses to inform 0 or more arguments.<\/p>\n<p>In the line after the declaration the code starts, remember to indent the block of code.<\/p>\n<p>Here is an example of a function called <code>print_first_function()<\/code> that only prints a phrase &#8216;My first function!&#8217;.<\/p>\n<p>To call the function just use its name as defined.<\/p>\n<pre><code class=\"language-python\">def print_first_function():\n    print(&#039;My first function!&#039;)\n\nprint_first_function()<\/code><\/pre>\n<pre><code>My first function!<\/code><\/pre>\n<h2><code>return<\/code> a value<\/h2>\n<p>Use the <code>return<\/code> keyword to return a value from the function.<\/p>\n<p>In this example the function <code>second_function()<\/code> returns the string &#8216;My second function!&#8217;.<\/p>\n<p>Notice that <code>print()<\/code> is a built-in function and our function is called from inside it.<\/p>\n<p>The string returned by <code>second_function()<\/code> is passed as argument to the <code>print()<\/code> function.<\/p>\n<pre><code class=\"language-python\">def second_function():\n    return &#039;My second function!&#039;\n\nprint(second_function())<\/code><\/pre>\n<pre><code>My second function!<\/code><\/pre>\n<h2><code>return<\/code>  multiple values<\/h2>\n<p>Functions can also return multiple values at once.<\/p>\n<p><code>return_numbers()<\/code> returns two values simultaneously.<\/p>\n<pre><code class=\"language-python\">def return_numbers():\n    return 10, 2\n\nprint(return_numbers())<\/code><\/pre>\n<pre><code>(10, 2)<\/code><\/pre>\n<h2>Arguments<\/h2>\n<p>You can define parameters between the parentheses.<\/p>\n<p>When calling a function with parameters you have to pass arguments according to the parameters defined.<\/p>\n<p>The past examples had no parameters, so there was no need for arguments, and the the parentheses remained empty when the functions were called.<\/p>\n<h3>One Argument<\/h3>\n<p>To specify one parameter, just define it inside the parentheses.<\/p>\n<p>In this example, the function <code>my_number<\/code> expects one number as argument defined by the parater <code>num<\/code>.<\/p>\n<p>The value of the argument is then accessible inside the function to be used.<\/p>\n<pre><code class=\"language-python\">def my_number(num):\n    return &#039;My number is: &#039; + str(num)\n\nprint(my_number(10))<\/code><\/pre>\n<pre><code>My number is: 10<\/code><\/pre>\n<h3>Two or more Arguments<\/h3>\n<p>To define more parameters, just use a comma to separate them.<\/p>\n<p>Here we have a function that adds two numbers called <code>add<\/code>, it expects two arguments defined by <code>first_num<\/code> and <code>second_num<\/code>.<\/p>\n<p>The arguments are added by the <code>+<\/code> operator and the result is then returned by the <code>return<\/code>.<\/p>\n<pre><code class=\"language-python\">def add(first_num, second_num):\n    return first_num + second_num\n\nprint(add(10,2))<\/code><\/pre>\n<pre><code>12<\/code><\/pre>\n<p>This example is very similar to the last one, the only difference is that we have 3 parameters instead of 2.<\/p>\n<pre><code class=\"language-python\">def add(first_num, second_num, third_num):\n    return first_num + second_num + third_num\n\nprint(add(10,2,3))<\/code><\/pre>\n<pre><code>15<\/code><\/pre>\n<p>This logic of defining parameters and passing arguments is the same for any number of parameters.<\/p>\n<p>It is important to point that the arguments have to be passed in the same order that the parameters are defined.<\/p>\n<h3>Default value.<\/h3>\n<p>You can set a default value for a parameter if no argument is given using the <code>=<\/code> operator and a value of choice.<\/p>\n<p>In this function, if no argument is given, the number 30 is assumed as the expected value by default.<\/p>\n<pre><code class=\"language-python\">def my_number(my_number = 30):\n    return &#039;My number is: &#039; + str(my_number)\n\nprint(my_number(10))\nprint(my_number())<\/code><\/pre>\n<pre><code>My number is: 10\nMy number is: 30<\/code><\/pre>\n<h3>Keyword or Named Arguments<\/h3>\n<p>When calling a function, the order of the arguments have to match the order of the parameters.<\/p>\n<p>The alternative is if you use keyword or named arguments.<\/p>\n<p>Set the arguments to their respective parameters directly using the name of the parameters and the <code>=<\/code> operators.<\/p>\n<p>This example flips the arguments, but the function works as expected because I tell which value goes to which parameter by name.<\/p>\n<pre><code class=\"language-python\">def my_numbers(first_number, second_number):\n    return &#039;The numbers are: &#039; + str(first_number) + &#039; and &#039; + str(second_number)\n\nprint(my_numbers(second_number=30, first_number=10))<\/code><\/pre>\n<pre><code>The numbers are: 10 and 30<\/code><\/pre>\n<h3>Any number of arguments: <code>*args<\/code><\/h3>\n<p>If you don&#8217;t want to specify the number of parameters, just use the <code>*<\/code> before the parameter name, and function will take as many arguments as necessary.<\/p>\n<p>The parameter name could be anything like <code><em>numbers<\/code>, but there is a convention in Python to use <code><\/em>args<\/code> for this difinition of a variable number of argumetns.<\/p>\n<pre><code class=\"language-python\">def my_numbers(*args):\n    for arg in args:\n        print(number)\n\nmy_numbers(10,2,3)<\/code><\/pre>\n<pre><code>10\n2\n3<\/code><\/pre>\n<h3>Any number of Keyword\/Named arguments: <code>**kwargs<\/code><\/h3>\n<p>Similar to <code>*args<\/code>, we can use <code><strong>kwargs<\/code> to pass as many keyword arguments as we want, as long as we use <code><\/strong><\/code>.<\/p>\n<p>Again, the name could be anything like <code><strong>numbers<\/code>, but <code><\/strong>kwargs<\/code> is a convention.<\/p>\n<pre><code class=\"language-python\">def my_numbers(**kwargs):\n    for key, value in kwargs.items():\n        print(key)\n        print(value)\n\nmy_numbers(first_number=30, second_number=10)<\/code><\/pre>\n<pre><code>first_number\n30\nsecond_number\n10<\/code><\/pre>\n<h3>Other types as arguments<\/h3>\n<p>The past examples used mainly numbers, but you can pass any type as argument and they will be treated as such inside the function.<\/p>\n<p>This example is taking strings as arguments.<\/p>\n<pre><code class=\"language-python\">def my_sport(sport):\n    print(&#039;I like &#039; + sport)\n\nmy_sport(&#039;football&#039;)\nmy_sport(&#039;swimming&#039;)<\/code><\/pre>\n<pre><code>I like football\nI like swimming<\/code><\/pre>\n<p>This function takes a list as argument.<\/p>\n<pre><code class=\"language-python\">def my_numbers(numbers):\n    for number in numbers:\n        print(number)\n\nmy_numbers([30, 10, 64, 92, 105])<\/code><\/pre>\n<pre><code>30\n10\n64\n92\n105<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>As the code grows the complexity also grows, functions help organizing the code. Functions are a handy way to create blocks of code that you can reuse. Definition and Calling In Python use the def keyword to define a function. Give it a name and use parentheses to inform 0 or more arguments. In the [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":742,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[6],"class_list":["post-1311","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Functions in Python<\/title>\n<meta name=\"description\" content=\"Learn how to use functions in Python.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/renanmf.com\/functions-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Functions in Python\" \/>\n<meta property=\"og:description\" content=\"Learn how to use functions in Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/renanmf.com\/functions-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Renan Moura - Software Engineering\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/renanmouraf\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-17T21:04:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-29T13:24:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/02\/fig-27-02-2020_21-01-52.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Renan Moura\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/renanmouraf\" \/>\n<meta name=\"twitter:site\" content=\"@renanmouraf\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Renan Moura\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/\"},\"author\":{\"name\":\"Renan Moura\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/#\\\/schema\\\/person\\\/1a6fd46256318d200c1c8a867448e5a8\"},\"headline\":\"Functions in Python\",\"datePublished\":\"2020-04-17T21:04:20+00:00\",\"dateModified\":\"2020-12-29T13:24:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/\"},\"wordCount\":595,\"publisher\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/fig-27-02-2020_21-01-52.jpg\",\"keywords\":[\"python\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/\",\"url\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/\",\"name\":\"Functions in Python\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/fig-27-02-2020_21-01-52.jpg\",\"datePublished\":\"2020-04-17T21:04:20+00:00\",\"dateModified\":\"2020-12-29T13:24:10+00:00\",\"description\":\"Learn how to use functions in Python.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/fig-27-02-2020_21-01-52.jpg\",\"contentUrl\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/fig-27-02-2020_21-01-52.jpg\",\"width\":1800,\"height\":1200,\"caption\":\"how to python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/functions-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\\\/\\\/renanmf.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Functions in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/#website\",\"url\":\"https:\\\/\\\/renanmf.com\\\/\",\"name\":\"Renan Moura - Software Engineering\",\"description\":\"Software development, machine learning\",\"publisher\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/renanmf.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/#organization\",\"name\":\"Renan Moura\",\"url\":\"https:\\\/\\\/renanmf.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/me-e1583179172701.jpeg\",\"contentUrl\":\"https:\\\/\\\/renanmf.com\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/me-e1583179172701.jpeg\",\"width\":120,\"height\":120,\"caption\":\"Renan Moura\"},\"image\":{\"@id\":\"https:\\\/\\\/renanmf.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/renanmouraf\",\"https:\\\/\\\/x.com\\\/renanmouraf\",\"https:\\\/\\\/instagram.com\\\/renanmouraf\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/renanmouraf\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/renanmf.com\\\/#\\\/schema\\\/person\\\/1a6fd46256318d200c1c8a867448e5a8\",\"name\":\"Renan Moura\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g\",\"caption\":\"Renan Moura\"},\"description\":\"I'm a Software Engineer working in the industry for a decade now. I like to solve problems with as little code as possible. I\u2019m interested in solving all sorts of problems with technology in creative and innovative ways. From everyday shell scripts to machine learning models. I write about Software Development, Machine Learning, and Career in tech.\",\"sameAs\":[\"https:\\\/\\\/renanmf.com\\\/\",\"https:\\\/\\\/www.instagram.com\\\/renanmouraf\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/renanmouraf\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/renanmouraf\"],\"url\":\"https:\\\/\\\/renanmf.com\\\/author\\\/renanmoura\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Functions in Python","description":"Learn how to use functions in Python.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/renanmf.com\/functions-python\/","og_locale":"en_US","og_type":"article","og_title":"Functions in Python","og_description":"Learn how to use functions in Python.","og_url":"https:\/\/renanmf.com\/functions-python\/","og_site_name":"Renan Moura - Software Engineering","article_publisher":"https:\/\/www.facebook.com\/renanmouraf","article_published_time":"2020-04-17T21:04:20+00:00","article_modified_time":"2020-12-29T13:24:10+00:00","og_image":[{"width":1800,"height":1200,"url":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/02\/fig-27-02-2020_21-01-52.jpg","type":"image\/jpeg"}],"author":"Renan Moura","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/renanmouraf","twitter_site":"@renanmouraf","twitter_misc":{"Written by":"Renan Moura","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/renanmf.com\/functions-python\/#article","isPartOf":{"@id":"https:\/\/renanmf.com\/functions-python\/"},"author":{"name":"Renan Moura","@id":"https:\/\/renanmf.com\/#\/schema\/person\/1a6fd46256318d200c1c8a867448e5a8"},"headline":"Functions in Python","datePublished":"2020-04-17T21:04:20+00:00","dateModified":"2020-12-29T13:24:10+00:00","mainEntityOfPage":{"@id":"https:\/\/renanmf.com\/functions-python\/"},"wordCount":595,"publisher":{"@id":"https:\/\/renanmf.com\/#organization"},"image":{"@id":"https:\/\/renanmf.com\/functions-python\/#primaryimage"},"thumbnailUrl":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/02\/fig-27-02-2020_21-01-52.jpg","keywords":["python"],"articleSection":["Python"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/renanmf.com\/functions-python\/","url":"https:\/\/renanmf.com\/functions-python\/","name":"Functions in Python","isPartOf":{"@id":"https:\/\/renanmf.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/renanmf.com\/functions-python\/#primaryimage"},"image":{"@id":"https:\/\/renanmf.com\/functions-python\/#primaryimage"},"thumbnailUrl":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/02\/fig-27-02-2020_21-01-52.jpg","datePublished":"2020-04-17T21:04:20+00:00","dateModified":"2020-12-29T13:24:10+00:00","description":"Learn how to use functions in Python.","breadcrumb":{"@id":"https:\/\/renanmf.com\/functions-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/renanmf.com\/functions-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/renanmf.com\/functions-python\/#primaryimage","url":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/02\/fig-27-02-2020_21-01-52.jpg","contentUrl":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/02\/fig-27-02-2020_21-01-52.jpg","width":1800,"height":1200,"caption":"how to python"},{"@type":"BreadcrumbList","@id":"https:\/\/renanmf.com\/functions-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/renanmf.com\/"},{"@type":"ListItem","position":2,"name":"Functions in Python"}]},{"@type":"WebSite","@id":"https:\/\/renanmf.com\/#website","url":"https:\/\/renanmf.com\/","name":"Renan Moura - Software Engineering","description":"Software development, machine learning","publisher":{"@id":"https:\/\/renanmf.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/renanmf.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/renanmf.com\/#organization","name":"Renan Moura","url":"https:\/\/renanmf.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/renanmf.com\/#\/schema\/logo\/image\/","url":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/03\/me-e1583179172701.jpeg","contentUrl":"https:\/\/renanmf.com\/wp-content\/uploads\/2020\/03\/me-e1583179172701.jpeg","width":120,"height":120,"caption":"Renan Moura"},"image":{"@id":"https:\/\/renanmf.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/renanmouraf","https:\/\/x.com\/renanmouraf","https:\/\/instagram.com\/renanmouraf","https:\/\/www.linkedin.com\/in\/renanmouraf\/"]},{"@type":"Person","@id":"https:\/\/renanmf.com\/#\/schema\/person\/1a6fd46256318d200c1c8a867448e5a8","name":"Renan Moura","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/efb78bdd04aa5627f80307aed5a9b31989d901c536d1e014a29a3c3591338af8?s=96&d=mm&r=g","caption":"Renan Moura"},"description":"I'm a Software Engineer working in the industry for a decade now. I like to solve problems with as little code as possible. I\u2019m interested in solving all sorts of problems with technology in creative and innovative ways. From everyday shell scripts to machine learning models. I write about Software Development, Machine Learning, and Career in tech.","sameAs":["https:\/\/renanmf.com\/","https:\/\/www.instagram.com\/renanmouraf\/","https:\/\/www.linkedin.com\/in\/renanmouraf\/","https:\/\/x.com\/https:\/\/twitter.com\/renanmouraf"],"url":"https:\/\/renanmf.com\/author\/renanmoura\/"}]}},"_links":{"self":[{"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/posts\/1311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/comments?post=1311"}],"version-history":[{"count":6,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/posts\/1311\/revisions"}],"predecessor-version":[{"id":2737,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/posts\/1311\/revisions\/2737"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/media\/742"}],"wp:attachment":[{"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/media?parent=1311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/categories?post=1311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/renanmf.com\/wp-json\/wp\/v2\/tags?post=1311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}