[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/thomasWeise/programmingWithPythonCode/main/syntax/if_else.py [Back]  [Original]

"""The syntax of an "if-else"-statement in Python."""

if booleanExpression:
    conditional statement 1  # Only executed if booleanExpression
    conditional statement 2  # evaluates to True.
    # ...
else:
    alternative statement 1  # Only executed if booleanExpression
    alternative statement 2  # evaluates to False.
    # ...

normal statement 1  # Always executed, regardless of the result of
normal statement 2  # booleanExpression.
# ...

Web Proxy Viewer  |  New URL  |  Original Page