{"id":6466,"date":"2020-12-17T08:40:28","date_gmt":"2020-12-17T03:10:28","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=6466"},"modified":"2021-07-09T16:46:36","modified_gmt":"2021-07-09T11:16:36","slug":"python-divmod","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/python-divmod\/","title":{"rendered":"Python Divmod And Its Application"},"content":{"rendered":"\n<p>Hello geeks and welcome to today&#8217;s article, we will discuss Python Divmod. Along with that, we will also look at its syntax and different parameters. For an overall better understanding, we will also look at a couple of examples. Let us try to get a general overview of Python Divmod. In elementary school, one of the first operations that we learn is Division.<\/p>\n\n\n\n<p><strong>Python divmod is a built-in function of Python (3.9.1). It takes 2 non-complex numbers as input and returns a tuple consisting of quotient and remainder. We can understand it as it takes dividends and divisors from the user. Whereas returns quotient and remainder. As we move,  we will look at different parameters associated with it one by one for better understanding.<\/strong><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/python-divmod\/#Syntax_Of_Python_Divmod\" >Syntax Of Python Divmod<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/python-divmod\/#Parameters_Of_Python_Divmod\" >Parameters Of Python Divmod<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/python-divmod\/#Return_Type_Of_Python_Divmod\" >Return Type Of Python Divmod<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/python-divmod\/#Examples_Of_Python_Divmod\" >Examples Of Python Divmod<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/python-divmod\/#Let_us_look_at_one_more_example\" >Let us look at one more example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/python-divmod\/#Can_you_use_Python_Divmod_for_Negative_Numbers\" >Can you use Python Divmod for Negative Numbers?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/python-divmod\/#Must_Read\" >Must Read<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/python-divmod\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-syntax-of-python-divmod\"><span class=\"ez-toc-section\" id=\"Syntax_Of_Python_Divmod\"><\/span>Syntax Of Python Divmod<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Now let us look at its parameter<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>divmod(x, y)<\/code><\/pre>\n\n\n\n<p>We can see that function has a relatively simpler syntax and only 2 parameters associated with it. We will try to understand the parameter up next. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-parameters-of-python-divmod\"><span class=\"ez-toc-section\" id=\"Parameters_Of_Python_Divmod\"><\/span>Parameters Of Python Divmod<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"has-medium-font-size\" id=\"h-x\"><strong>x<\/strong>: int or float<br>It represents the numerator or the dividend. It must be a <strong>non-complex <\/strong>number. <\/p>\n\n\n\n<p class=\"has-medium-font-size\" id=\"h-y\"><strong>y<\/strong>: int or float<br>It represents the denominator or the divisor. Like its counterpart, it also must be <strong>non-complex<\/strong> in nature.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-return-type-of-python-divmod\"><span class=\"ez-toc-section\" id=\"Return_Type_Of_Python_Divmod\"><\/span>Return Type Of Python Divmod<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>After performing the operation it returns the quotient and remainder.<\/p>\n\n\n\n<p><strong>OUT<\/strong>:<strong>(q,r)<\/strong><\/p>\n\n\n\n<p>Another point to pay emphasis on is the data type of input. If both X and Y have data-type &#8220;<strong>int,<\/strong>&#8221; then output has a similar <a href=\"http:\/\/www.pythonpool.com\/python-data-types\/\" target=\"_blank\" rel=\"noreferrer noopener\">data type<\/a>.  But in case one has data-type &#8220;float&#8221; and other &#8220;int,&#8221; in that case, the output is of data-type &#8216;float.&#8217; <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-examples-of-python-divmod\"><span class=\"ez-toc-section\" id=\"Examples_Of_Python_Divmod\"><\/span>Examples Of Python Divmod<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Now let us look at some of the basic examples and play with the syntax for a bit.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#input\nprint(divmod(45,9))\nprint(divmod(16.0,4.0))\nprint(divmod(12.0,5))\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(5, 0)\n(4.0, 0.0)\n(2.0, 2.0)<\/code><\/pre>\n\n\n\n<p>In the above example, we have used the standard syntax &#8220;divmod(x, y).&#8221; In the first 2 examples, our divisor and dividend are of the same type. Whereas in the 3rd, both have different data-types one float and the int. Here we can see that our output is in the form of float.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-let-us-look-at-one-more-example\"><span class=\"ez-toc-section\" id=\"Let_us_look_at_one_more_example\"><\/span>Let us look at one more example<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n#input\nprint(divmod(5,0))\nprint(divmod(0,5))\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ZeroDivisionError: integer division or modulo by zero\n(0, 0)<\/code><\/pre>\n\n\n\n<p>In the one above example, we have tried to analyze how it behaves if either the divisor or dividend is equal to 0. In the first case where the divisor is equal to zero in output, we get an error. While in the second case, where the dividend is zero, we get an output equal to (0,0). <\/p>\n\n\n\n<p>Now let us try to look into its application. We all know about composite numbers. The numbers that have <a href=\"http:\/\/www.pythonpool.com\/prime-factorization-python\/\" target=\"_blank\" rel=\"noreferrer noopener\">more than 2 factors<\/a>. We can check it for any number using the Python Divmod function. Also, if a number is not composite, it must be <a href=\"https:\/\/en.wikipedia.org\/wiki\/Prime_number\" target=\"_blank\" rel=\"noreferrer noopener\">prime<\/a> unless and until it is &#8220;1&#8221;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-1\">Example 1:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nn = 18\nx = n \ncount = 0\nwhile x != 0: \n    p, q = divmod(n, x) \n    x-= 1\n    if q == 0: \n        count+= 1\nif count&gt;2: \n    print('composite') \nelse: \n    print('Prime')\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-2\">Example 2:<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nn = 19\nx = n\ncount = 0\nwhile x != 0:\np, q = divmod(n, x)\nx-= 1\nif q == 0:\ncount+= 1\nif count&gt;2:\nprint('composite')\nelse:\nprint('Prime')\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-code\"><code>#output\ncomposite\nPrime<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-explanation\">Explanation:<\/h3>\n\n\n\n<p>In the above example, we have used the Divmod function to determine whether the number is composite or prime. This can be used for any number and makes our work a lot easier. Here we have defined a counter =0 and then compared that counter with 2. If greater than 2, then &#8220;composite&#8221; else &#8220;prime.&#8221;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-can-you-use-python-divmod-for-negative-numbers\"><span class=\"ez-toc-section\" id=\"Can_you_use_Python_Divmod_for_Negative_Numbers\"><\/span>Can you use Python Divmod for Negative Numbers?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Yes, you can absolutely use it on negative numbers. a\/\/b will be a negative number if a is negative. Moreover, (a\/\/b)*b will result in a negative step after division. The following example will help you understand &#8211; <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nprint('divmod(-8, 5) = ', divmod(-8, 5))\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ndivmod(-8, 5) =  (-2, 2)\n<\/pre><\/div>\n\n\n<h2 class=\"has-vivid-purple-color has-text-color wp-block-heading\" id=\"h-must-read\"><span class=\"ez-toc-section\" id=\"Must_Read\"><\/span>Must Read<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"http:\/\/www.pythonpool.com\/python-max-int\/\" rel=\"noreferrer noopener\" target=\"_blank\">Python Max Int | What&#8217;s the Maximum Value of int Data Type in Python<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/python-int-to-binary\/\" rel=\"noreferrer noopener\" target=\"_blank\">Python int to Binary | Integer to Binary Conversion<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/numpy-diff\/\" rel=\"noreferrer noopener\" target=\"_blank\">WHAT IS NUMPY DIFF? ALONG WITH EXAMPLES<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/numpy-log\/\" rel=\"noreferrer noopener\" target=\"_blank\">NumPy log Function() | What is Numpy log in Python<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we covered Python Divmod. For a better understanding, we looked at its syntax, parameters. We looked at a couple of examples and also looked at their application. In the end, we conclude that Python Divmod is a built-in feature that returns the quotient and remainder for a non-complex input. I hope this article was able to clear all of your doubts. In case if you any doubt feel free to write them below in the comment section. Done reading this, why not read <a href=\"http:\/\/www.pythonpool.com\/numpy-digitize\/\">NumPy Digitize<\/a> next.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello geeks and welcome to today&#8217;s article, we will discuss Python Divmod. Along with that, we will also look at its syntax and different parameters. &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Python Divmod And Its Application\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/python-divmod\/#more-6466\" aria-label=\"More on Python Divmod And Its Application\">Read more<\/a><\/p>\n","protected":false},"author":11,"featured_media":6538,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[15],"tags":[2835,2832,2837,2839,2833,2838,2831,2830,2836,2840,2834],"class_list":["post-6466","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-divmod-in-python","tag-divmod-python","tag-divmod-python-3","tag-divmod-python-example","tag-divmod-python-2","tag-how-to-use-divmod-in-python","tag-python-3-divmod","tag-python-3-6-divmod","tag-python-divmod-int","tag-python-float-divmod","tag-what-is-divmod-in-python","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python Divmod And Its Application - Python Pool<\/title>\n<meta name=\"description\" content=\"Python divmod is a built-in function of Python (3.9.1). It takes 2 non-complex numbers as input and returns a tuple consisting of quotient...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/python-divmod\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Divmod And Its Application\" \/>\n<meta property=\"og:description\" content=\"Hello geeks and welcome to today&#039;s article, we will discuss Python Divmod. Along with that, we will also look at its syntax and different parameters. For\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/python-divmod\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-17T03:10:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-09T11:16:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-31.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1350\" \/>\n\t<meta property=\"og:image:height\" content=\"650\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Rohit Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rohit Kumar\" \/>\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:\/\/www.pythonpool.com\/python-divmod\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-divmod\/\"},\"author\":{\"name\":\"Rohit Kumar\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/664ced779ebbb8ddfd3c58a60d6f9d66\"},\"headline\":\"Python Divmod And Its Application\",\"datePublished\":\"2020-12-17T03:10:28+00:00\",\"dateModified\":\"2021-07-09T11:16:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-divmod\/\"},\"wordCount\":688,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-divmod\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-31.png\",\"keywords\":[\"divmod in python\",\"divmod python\",\"divmod python 3\",\"divmod python example\",\"divmod() python\",\"how to use divmod in python\",\"python 3 divmod\",\"python 3.6 divmod\",\"python divmod int\",\"python float divmod\",\"what is divmod in python\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/python-divmod\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/python-divmod\/\",\"url\":\"https:\/\/www.pythonpool.com\/python-divmod\/\",\"name\":\"Python Divmod And Its Application - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-divmod\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-divmod\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-31.png\",\"datePublished\":\"2020-12-17T03:10:28+00:00\",\"dateModified\":\"2021-07-09T11:16:36+00:00\",\"description\":\"Python divmod is a built-in function of Python (3.9.1). It takes 2 non-complex numbers as input and returns a tuple consisting of quotient...\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-divmod\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/python-divmod\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/python-divmod\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-31.png\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-31.png\",\"width\":1350,\"height\":650,\"caption\":\"PYTHON DIVMOD\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/python-divmod\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Divmod And Its Application\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/664ced779ebbb8ddfd3c58a60d6f9d66\",\"name\":\"Rohit Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c9a762a12f6bf9093f4c8a7643c0b6a17dd903d9602fae379649d1b050386b1a?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c9a762a12f6bf9093f4c8a7643c0b6a17dd903d9602fae379649d1b050386b1a?s=96&d=wavatar&r=g\",\"caption\":\"Rohit Kumar\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python Divmod And Its Application - Python Pool","description":"Python divmod is a built-in function of Python (3.9.1). It takes 2 non-complex numbers as input and returns a tuple consisting of quotient...","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:\/\/www.pythonpool.com\/python-divmod\/","og_locale":"en_US","og_type":"article","og_title":"Python Divmod And Its Application","og_description":"Hello geeks and welcome to today's article, we will discuss Python Divmod. Along with that, we will also look at its syntax and different parameters. For","og_url":"https:\/\/www.pythonpool.com\/python-divmod\/","og_site_name":"Python Pool","article_published_time":"2020-12-17T03:10:28+00:00","article_modified_time":"2021-07-09T11:16:36+00:00","og_image":[{"width":1350,"height":650,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-31.png","type":"image\/png"}],"author":"Rohit Kumar","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Rohit Kumar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/python-divmod\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/python-divmod\/"},"author":{"name":"Rohit Kumar","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/664ced779ebbb8ddfd3c58a60d6f9d66"},"headline":"Python Divmod And Its Application","datePublished":"2020-12-17T03:10:28+00:00","dateModified":"2021-07-09T11:16:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-divmod\/"},"wordCount":688,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-divmod\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-31.png","keywords":["divmod in python","divmod python","divmod python 3","divmod python example","divmod() python","how to use divmod in python","python 3 divmod","python 3.6 divmod","python divmod int","python float divmod","what is divmod in python"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/python-divmod\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/python-divmod\/","url":"https:\/\/www.pythonpool.com\/python-divmod\/","name":"Python Divmod And Its Application - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-divmod\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-divmod\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-31.png","datePublished":"2020-12-17T03:10:28+00:00","dateModified":"2021-07-09T11:16:36+00:00","description":"Python divmod is a built-in function of Python (3.9.1). It takes 2 non-complex numbers as input and returns a tuple consisting of quotient...","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/python-divmod\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/python-divmod\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/python-divmod\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-31.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/12\/Theatre-Actor-Portfolio-Website-31.png","width":1350,"height":650,"caption":"PYTHON DIVMOD"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/python-divmod\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Python Divmod And Its Application"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/664ced779ebbb8ddfd3c58a60d6f9d66","name":"Rohit Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c9a762a12f6bf9093f4c8a7643c0b6a17dd903d9602fae379649d1b050386b1a?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c9a762a12f6bf9093f4c8a7643c0b6a17dd903d9602fae379649d1b050386b1a?s=96&d=wavatar&r=g","caption":"Rohit Kumar"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/6466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=6466"}],"version-history":[{"count":15,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/6466\/revisions"}],"predecessor-version":[{"id":14438,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/6466\/revisions\/14438"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/6538"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=6466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=6466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=6466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}