{"id":12356,"date":"2023-11-08T10:14:05","date_gmt":"2023-11-08T04:44:05","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/"},"modified":"2024-12-20T12:41:39","modified_gmt":"2024-12-20T07:11:39","slug":"armstrong-number-in-python","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/","title":{"rendered":"Armstrong Number in Python"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"what-is-an-armstrong-number\"><strong>What is an Armstrong Number?<\/strong><\/h2>\n\n\n\n<p>An <strong>Armstrong number<\/strong> (or <strong>narcissistic number<\/strong>) in a given number base is a number that equals the sum of its own digits, each raised to the power of the number of digits. These numbers are a fascinating concept in number theory and a common starting point for beginners in programming. For example, in base 10:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example\"><strong>Example:<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n153 = 1\u00b3 + 5\u00b3 + 3\u00b3 = 153\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"key-properties\"><strong>Key Properties:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>An Armstrong number can exist in any number base.<\/li>\n\n\n\n<li>In base 10, single-digit numbers (0 and 1) are considered Armstrong numbers.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"armstrong-number-examples\"><strong>Armstrong Number Examples<\/strong><\/h2>\n\n\n\n<p>Here are some examples of Armstrong numbers in the decimal system:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>3-Digit Numbers:<\/strong>\n<ul class=\"wp-block-list\">\n<li>153: 1\u00b3 + 5\u00b3 + 3\u00b3 = 153<\/li>\n\n\n\n<li>370: 3\u00b3 + 7\u00b3 + 0\u00b3 = 370<\/li>\n\n\n\n<li>371: 3\u00b3 + 7\u00b3 + 1\u00b3 = 371<\/li>\n\n\n\n<li>407: 4\u00b3 + 0\u00b3 + 7\u00b3 = 407<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>4-Digit Numbers:<\/strong>\n<ul class=\"wp-block-list\">\n<li>1634: 1\u2074 + 6\u2074 + 3\u2074 + 4\u2074 = 1634<\/li>\n\n\n\n<li>8208: 8\u2074 + 2\u2074 + 0\u2074 + 8\u2074 = 8208<\/li>\n\n\n\n<li>9474: 9\u2074 + 4\u2074 + 7\u2074 + 4\u2074 = 9474<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"armstrong-numbers-in-base-3\"><strong>Armstrong Numbers in Base 3<\/strong><\/h3>\n\n\n\n<p>Even in other bases, Armstrong numbers exist. For example: 122 (base 3) = 1\u00b3 + 2\u00b3 + 2\u00b3 = 17 (decimal).<\/p>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Academy Pro<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/master-python-programming\" class=\"courses-cta-title-link\">Python Programming Course<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">In this course, you will learn the fundamentals of Python: from basic syntax to mastering data structures, loops, and functions. You will also explore OOP concepts and objects to build robust programs.<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>11.5 Hrs<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>51 Coding Exercises<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/master-python-programming\" class=\"courses-cta-button\">\n                Start Free Trial\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-check-for-armstrong-numbers\"><strong>How to Check for Armstrong Numbers<\/strong>?<\/h2>\n\n\n\n<p>To determine whether a number is an Armstrong number, follow this algorithm:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"algorithm\"><strong>Algorithm:<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Input:<\/strong> Take the number to be checked.<\/li>\n\n\n\n<li><strong>Find Digits:<\/strong> Determine the number of digits (\u201cn\u201d).<\/li>\n\n\n\n<li><strong>Process Each Digit:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Extract each digit using modulus (num % 10).<\/li>\n\n\n\n<li>Raise the digit to the power of \u201cn\u201d.<\/li>\n\n\n\n<li>Add the result to a running total.<\/li>\n\n\n\n<li>Divide the number by 10 to move to the next digit.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Compare:<\/strong> If the total equals the original number, it\u2019s an Armstrong number.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-algorithm-in-python\"><strong>Example Algorithm in Python:<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nnum = int(input(&quot;Enter a number: &quot;))\noriginal = num\nsum = 0\nn = len(str(num))\n\nwhile num &gt; 0:\n    digit = num % 10\n    sum += digit ** n\n    num \/\/= 10\n\nif sum == original:\n    print(f&quot;{original} is an Armstrong Number!&quot;)\nelse:\n    print(f&quot;{original} is not an Armstrong Number.&quot;)\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"output-example\"><strong>Output Example:<\/strong><\/h3>\n\n\n\n<p><strong>Enter a number:<\/strong> 153<\/p>\n\n\n\n<p>153 is an Armstrong Number!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"python-programs-for-armstrong-numbers\"><strong>Python Programs for Armstrong Numbers<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"check-a-specific-number\"><strong>Check a Specific Number:<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nnum = int(input(&quot;Enter a number: &quot;))\noriginal = num\nsum = 0\nn = len(str(num))\n\nwhile num &gt; 0:\n    digit = num % 10\n    sum += digit ** n\n    num \/\/= 10\n\nif sum == original:\n    print(f&quot;{original} is an Armstrong Number.&quot;)\nelse:\n    print(f&quot;{original} is not an Armstrong Number.&quot;)\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"output-example\"><strong>Output Example:<\/strong><\/h4>\n\n\n\n<p><strong>Enter a number:<\/strong> 123<\/p>\n\n\n\n<p>123 is not an Armstrong Number.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"find-armstrong-numbers-in-a-range\"><strong>Find Armstrong Numbers in a Range:<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nt1 = int(input(&quot;Enter the minimum value: &quot;))\nt2 = int(input(&quot;Enter the maximum value: &quot;))\n\nprint(&quot;Armstrong numbers in the range:&quot;)\nfor num in range(t1, t2 + 1):\n    original = num\n    sum = 0\n    n = len(str(num))\n\n    while num &gt; 0:\n        digit = num % 10\n        sum += digit ** n\n        num \/\/= 10\n\n    if sum == original:\n        print(original)\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"output-example\"><strong>Output Example:<\/strong><\/h4>\n\n\n\n<p><strong>Enter the minimum value:<\/strong> 100<\/p>\n\n\n\n<p><strong>Enter the maximum value: <\/strong>500<\/p>\n\n\n\n<p><strong>Armstrong numbers in the range:<\/strong> 153, 370, 371, 407<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"print-the-first-n-armstrong-numbers\"><strong>Print the First \u201cN\u201d Armstrong Numbers:<\/strong><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nN = int(input(&quot;Enter the number of Armstrong numbers to find: &quot;))\ncount = 0\nnum = 1\n\nprint(&quot;The first&quot;, N, &quot;Armstrong numbers are:&quot;)\nwhile count &amp;lt; N:\n    original = num\n    sum = 0\n    n = len(str(num))\n\n    while num &gt; 0:\n        digit = num % 10\n        sum += digit ** n\n        num \/\/= 10\n\n    if sum == original:\n        print(original)\n        count += 1\n\n    num += 1\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"output-example\"><strong>Output Example:<\/strong><\/h4>\n\n\n\n<p>Enter the number of Armstrong numbers to find: 5<\/p>\n\n\n\n<p><strong>The first 5 Armstrong numbers are:<\/strong> 1, 153, 370, 371, 407<\/p>\n\n\n\n<p>Practicing such problems with different inputs similar to performing what-if analysis in Excel helps improve logic-building skills, and a <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/python-fundamentals-for-beginners\" type=\"link\" id=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/python-fundamentals-for-beginners\">Free Python Course<\/a><strong> <\/strong>is a great way to get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>In this blog, we explored the concept of Armstrong numbers, their properties, examples, and Python implementations. Armstrong numbers may not have real-world applications but are a fun and educational topic for programming practice. For more tutorials on Python and machine learning, stay tuned!<\/p>\n\n\n\n<p><strong>Also Read:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/prime-numbers-program-in-python\/\">Prime Numbers Program In Python<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/add-python-to-path\/\">How To Add Python To Path?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/python-init\/\">Python __init__<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>An armstrong number in a given number base b is a number that is the sum of its own digits each raised to the power of the number of digits<\/p>\n","protected":false},"author":41,"featured_media":12560,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","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":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","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":""},"categories":[25860],"tags":[36796],"content_type":[],"class_list":["post-12356","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-python"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.6 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Armstrong Number in Python<\/title>\n<meta name=\"description\" content=\"Armstrong Number in Python: Armstrong Number is the number whose sum of each digit is powered to the total number of digits.\" \/>\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.mygreatlearning.com\/blog\/armstrong-number-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Armstrong Number in Python\" \/>\n<meta property=\"og:description\" content=\"Armstrong Number in Python: Armstrong Number is the number whose sum of each digit is powered to the total number of digits.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-08T04:44:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-20T07:11:39+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"700\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Armstrong Number in Python\",\"datePublished\":\"2023-11-08T04:44:05+00:00\",\"dateModified\":\"2024-12-20T07:11:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/\"},\"wordCount\":364,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png\",\"keywords\":[\"python\"],\"articleSection\":[\"IT\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/\",\"url\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/\",\"name\":\"Armstrong Number in Python\",\"isPartOf\":{\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png\",\"datePublished\":\"2023-11-08T04:44:05+00:00\",\"dateModified\":\"2024-12-20T07:11:39+00:00\",\"description\":\"Armstrong Number in Python: Armstrong Number is the number whose sum of each digit is powered to the total number of digits.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#primaryimage\",\"url\":\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png\",\"contentUrl\":\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png\",\"width\":1000,\"height\":700,\"caption\":\"armstrong in python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/www.mygreatlearning.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IT\/Software Development\",\"item\":\"https:\/\/www.mygreatlearning.com\/blog\/software\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Armstrong Number in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/#website\",\"url\":\"https:\/\/www.mygreatlearning.com\/blog\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\/\/www.mygreatlearning.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg\",\"contentUrl\":\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\",\"https:\/\/x.com\/Great_Learning\",\"https:\/\/www.instagram.com\/greatlearningofficial\/\",\"https:\/\/www.linkedin.com\/school\/great-learning\/\",\"https:\/\/in.pinterest.com\/greatlearning12\/\",\"https:\/\/www.youtube.com\/user\/beaconelearning\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp\",\"contentUrl\":\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\/\/www.mygreatlearning.com\/\",\"https:\/\/in.linkedin.com\/school\/great-learning\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning\",\"https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Armstrong Number in Python","description":"Armstrong Number in Python: Armstrong Number is the number whose sum of each digit is powered to the total number of digits.","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.mygreatlearning.com\/blog\/armstrong-number-in-python\/","og_locale":"en_US","og_type":"article","og_title":"Armstrong Number in Python","og_description":"Armstrong Number in Python: Armstrong Number is the number whose sum of each digit is powered to the total number of digits.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2023-11-08T04:44:05+00:00","article_modified_time":"2024-12-20T07:11:39+00:00","og_image":[{"width":1000,"height":700,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png","type":"image\/png"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Armstrong Number in Python","datePublished":"2023-11-08T04:44:05+00:00","dateModified":"2024-12-20T07:11:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/"},"wordCount":364,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png","keywords":["python"],"articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/","url":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/","name":"Armstrong Number in Python","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png","datePublished":"2023-11-08T04:44:05+00:00","dateModified":"2024-12-20T07:11:39+00:00","description":"Armstrong Number in Python: Armstrong Number is the number whose sum of each digit is powered to the total number of digits.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png","width":1000,"height":700,"caption":"armstrong in python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/armstrong-number-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"IT\/Software Development","item":"https:\/\/www.mygreatlearning.com\/blog\/software\/"},{"@type":"ListItem","position":3,"name":"Armstrong Number in Python"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png",1000,700,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1-150x150.png",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1-300x210.png",300,210,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1-768x538.png",768,538,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png",1000,700,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png",1000,700,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png",1000,700,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png",640,448,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png",96,67,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/02\/Feb-14-blog-thumbnail-armstrong-number-1.png",150,105,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"An armstrong number in a given number base b is a number that is the sum of its own digits each raised to the power of the number of digits","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/12356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=12356"}],"version-history":[{"count":27,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/12356\/revisions"}],"predecessor-version":[{"id":116935,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/12356\/revisions\/116935"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/12560"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=12356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=12356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=12356"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=12356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}