Python Rules: Indentation, Capitalization, and Loop Control Explained
A DEV Community article outlines core Python rules governing code structure and logic. It explains that lines ending with a colon, such as while or if statements, begin a code block whose lines must be indented by four spaces or one Tab. Python also distinguishes uppercase from lowercase, requiring True and False to be capitalized while control keywords like while, if, and break stay lowercase. The piece notes that a while loop runs only while its condition evaluates to True, and that using while True creates a loop that continues until it is manually stopped. Breaking these rules, the article warns, leads to syntax errors or infinite loops.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in