{"id":232611,"date":"2025-02-06T16:25:56","date_gmt":"2025-02-06T15:25:56","guid":{"rendered":"https:\/\/glosarix.com\/glossary\/indentation-en\/"},"modified":"2025-02-06T16:25:56","modified_gmt":"2025-02-06T15:25:56","slug":"indentation-en","status":"publish","type":"glossary","link":"https:\/\/glosarix.com\/en\/glossary\/indentation-en\/","title":{"rendered":"Indentation"},"content":{"rendered":"<p>Description: Indentation in programming refers to the whitespace at the beginning of a line of code that indicates a block of code. Unlike other programming languages that use braces or keywords to define blocks, some languages, such as Python, use indentation as a way to structure the code. This means that the amount of whitespace at the start of a line is crucial for the correct interpretation of the code by the interpreter. Indentation can be done with spaces or tabs, although it is recommended to use spaces to maintain consistency and avoid errors. Proper indentation not only improves code readability but is also essential for its functionality, as an indentation error can lead to execution errors or unexpected behaviors. In such languages, indentation is used to define control structures such as loops, conditionals, and functions, allowing for clear and logical code organization.<\/p>\n<p>History: Indentation in programming languages like Python dates back to the creation of the language by Guido van Rossum in 1989. From its inception, Python was designed with a focus on code readability, and the decision to use indentation as a block delimiter was a fundamental part of this philosophy. Over the years, Python has evolved, but the importance of indentation has remained constant, becoming a distinctive feature of the language.<\/p>\n<p>Uses: Indentation is used in programming to define code blocks in control structures such as loops (for, while), conditionals (if, else), and functions. This allows the interpreter to understand the hierarchy and flow of the program. Additionally, indentation is crucial for code organization, making it easier to read and maintain.<\/p>\n<p>Examples: An example of using indentation in Python is as follows:<\/p>\n<p>&#8220;`python<br \/>\nif x > 10:<br \/>\n    print(&#8216;x is greater than 10&#8217;)<br \/>\nelse:<br \/>\n    print(&#8216;x is 10 or less&#8217;)<br \/>\n&#8220;`<br \/>\nIn this case, the lines within the conditional structure are indented to indicate that they belong to the &#8216;if&#8217; or &#8216;else&#8217; block.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: Indentation in programming refers to the whitespace at the beginning of a line of code that indicates a block of code. Unlike other programming languages that use braces or keywords to define blocks, some languages, such as Python, use indentation as a way to structure the code. This means that the amount of whitespace [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"glossary-categories":[12038],"glossary-tags":[12994],"glossary-languages":[],"class_list":["post-232611","glossary","type-glossary","status-publish","hentry","glossary-categories-python-en","glossary-tags-python-en"],"post_title":"Indentation ","post_content":"Description: Indentation in programming refers to the whitespace at the beginning of a line of code that indicates a block of code. Unlike other programming languages that use braces or keywords to define blocks, some languages, such as Python, use indentation as a way to structure the code. This means that the amount of whitespace at the start of a line is crucial for the correct interpretation of the code by the interpreter. Indentation can be done with spaces or tabs, although it is recommended to use spaces to maintain consistency and avoid errors. Proper indentation not only improves code readability but is also essential for its functionality, as an indentation error can lead to execution errors or unexpected behaviors. In such languages, indentation is used to define control structures such as loops, conditionals, and functions, allowing for clear and logical code organization.\n\nHistory: Indentation in programming languages like Python dates back to the creation of the language by Guido van Rossum in 1989. From its inception, Python was designed with a focus on code readability, and the decision to use indentation as a block delimiter was a fundamental part of this philosophy. Over the years, Python has evolved, but the importance of indentation has remained constant, becoming a distinctive feature of the language.\n\nUses: Indentation is used in programming to define code blocks in control structures such as loops (for, while), conditionals (if, else), and functions. This allows the interpreter to understand the hierarchy and flow of the program. Additionally, indentation is crucial for code organization, making it easier to read and maintain.\n\nExamples: An example of using indentation in Python is as follows:\n\n```python\nif x > 10:\n    print('x is greater than 10')\nelse:\n    print('x is 10 or less')\n```\nIn this case, the lines within the conditional structure are indented to indicate that they belong to the 'if' or 'else' block.","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Indentation - Glosarix<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/glosarix.com\/en\/glossary\/indentation-en\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Indentation - Glosarix\" \/>\n<meta property=\"og:description\" content=\"Description: Indentation in programming refers to the whitespace at the beginning of a line of code that indicates a block of code. Unlike other programming languages that use braces or keywords to define blocks, some languages, such as Python, use indentation as a way to structure the code. This means that the amount of whitespace [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/glosarix.com\/en\/glossary\/indentation-en\/\" \/>\n<meta property=\"og:site_name\" content=\"Glosarix\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@GlosarixOficial\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/glosarix.com\\\/en\\\/glossary\\\/indentation-en\\\/\",\"url\":\"https:\\\/\\\/glosarix.com\\\/en\\\/glossary\\\/indentation-en\\\/\",\"name\":\"Indentation - Glosarix\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/glosarix.com\\\/en\\\/#website\"},\"datePublished\":\"2025-02-06T15:25:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/glosarix.com\\\/en\\\/glossary\\\/indentation-en\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/glosarix.com\\\/en\\\/glossary\\\/indentation-en\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/glosarix.com\\\/en\\\/glossary\\\/indentation-en\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\\\/\\\/glosarix.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Indentation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/glosarix.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/glosarix.com\\\/en\\\/\",\"name\":\"Glosarix\",\"description\":\"T\u00e9rminos tecnol\u00f3gicos - Glosarix\",\"publisher\":{\"@id\":\"https:\\\/\\\/glosarix.com\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/glosarix.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/glosarix.com\\\/en\\\/#organization\",\"name\":\"Glosarix\",\"url\":\"https:\\\/\\\/glosarix.com\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/glosarix.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/glosarix.com\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Glosarix-logo-192x192-1.png.webp\",\"contentUrl\":\"https:\\\/\\\/glosarix.com\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/Glosarix-logo-192x192-1.png.webp\",\"width\":192,\"height\":192,\"caption\":\"Glosarix\"},\"image\":{\"@id\":\"https:\\\/\\\/glosarix.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/GlosarixOficial\",\"https:\\\/\\\/www.instagram.com\\\/glosarixoficial\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Indentation - Glosarix","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:\/\/glosarix.com\/en\/glossary\/indentation-en\/","og_locale":"en_US","og_type":"article","og_title":"Indentation - Glosarix","og_description":"Description: Indentation in programming refers to the whitespace at the beginning of a line of code that indicates a block of code. Unlike other programming languages that use braces or keywords to define blocks, some languages, such as Python, use indentation as a way to structure the code. This means that the amount of whitespace [&hellip;]","og_url":"https:\/\/glosarix.com\/en\/glossary\/indentation-en\/","og_site_name":"Glosarix","twitter_card":"summary_large_image","twitter_site":"@GlosarixOficial","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/glosarix.com\/en\/glossary\/indentation-en\/","url":"https:\/\/glosarix.com\/en\/glossary\/indentation-en\/","name":"Indentation - Glosarix","isPartOf":{"@id":"https:\/\/glosarix.com\/en\/#website"},"datePublished":"2025-02-06T15:25:56+00:00","breadcrumb":{"@id":"https:\/\/glosarix.com\/en\/glossary\/indentation-en\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/glosarix.com\/en\/glossary\/indentation-en\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/glosarix.com\/en\/glossary\/indentation-en\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/glosarix.com\/en\/"},{"@type":"ListItem","position":2,"name":"Indentation"}]},{"@type":"WebSite","@id":"https:\/\/glosarix.com\/en\/#website","url":"https:\/\/glosarix.com\/en\/","name":"Glosarix","description":"T\u00e9rminos tecnol\u00f3gicos - Glosarix","publisher":{"@id":"https:\/\/glosarix.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/glosarix.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/glosarix.com\/en\/#organization","name":"Glosarix","url":"https:\/\/glosarix.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/glosarix.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/glosarix.com\/wp-content\/uploads\/2025\/04\/Glosarix-logo-192x192-1.png.webp","contentUrl":"https:\/\/glosarix.com\/wp-content\/uploads\/2025\/04\/Glosarix-logo-192x192-1.png.webp","width":192,"height":192,"caption":"Glosarix"},"image":{"@id":"https:\/\/glosarix.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/GlosarixOficial","https:\/\/www.instagram.com\/glosarixoficial\/"]}]}},"_links":{"self":[{"href":"https:\/\/glosarix.com\/en\/wp-json\/wp\/v2\/glossary\/232611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/glosarix.com\/en\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/glosarix.com\/en\/wp-json\/wp\/v2\/types\/glossary"}],"author":[{"embeddable":true,"href":"https:\/\/glosarix.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/glosarix.com\/en\/wp-json\/wp\/v2\/comments?post=232611"}],"version-history":[{"count":0,"href":"https:\/\/glosarix.com\/en\/wp-json\/wp\/v2\/glossary\/232611\/revisions"}],"wp:attachment":[{"href":"https:\/\/glosarix.com\/en\/wp-json\/wp\/v2\/media?parent=232611"}],"wp:term":[{"taxonomy":"glossary-categories","embeddable":true,"href":"https:\/\/glosarix.com\/en\/wp-json\/wp\/v2\/glossary-categories?post=232611"},{"taxonomy":"glossary-tags","embeddable":true,"href":"https:\/\/glosarix.com\/en\/wp-json\/wp\/v2\/glossary-tags?post=232611"},{"taxonomy":"glossary-languages","embeddable":true,"href":"https:\/\/glosarix.com\/en\/wp-json\/wp\/v2\/glossary-languages?post=232611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}