Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Off-side rule
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Example == The following is an example of indentation blocks in [[Python (programming language)|Python]]; a popular off-side rule language. In Python, the rule is taken to define the boundaries of statements rather than declarations. <syntaxhighlight lang="python" line> def is_even(a: int) -> bool: if a % 2 == 0: print('Even!') return True print('Odd!') return False </syntaxhighlight> The body of the function starts on line 2 since it is indented one level (4 spaces) more than the previous line. The <code>if</code> clause body starts on line 3 since it is indented an additional level, and ends on line 4 since line 5 is indented a level less, a.k.a. outdented. The colon (<code>:</code>) at the end of a control statement line is Python syntax; not an aspect of the off-side rule. The rule can be realized without such colon syntax.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)