GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Processing
  • p5.js
  • Processing.py
  • Processing for Android
  • Processing for Pi
  • Processing Foundation

This view

  • Original page
  • New address

GeezerVison is showing py.processing.org — else \ Language (API)

Python Mode for Processing is no longer maintained. This site is kept as an archive. Read more
  • Processing
  • p5.js
  • Processing.py
  • Processing for Android
  • Processing for Pi
  • Processing Foundation
Cover
Reference
Tutorials
Examples
Bugs
Name

else

Examples
for i in range(5, 95, 5): 
    if i < 35:
        line(30, i, 80, i)
    else:
        line(20, i, 90, i)
for i in range(5, 95, 5): 
    if i < 35:
        line(30, i, 80, i)
    elif i < 65:
        line(20, i, 90, i)
    else:
        line(0, i, 100, i)
Description Extends the if structure allowing the program to choose between two or more blocks of code. It specifies a block of code to execute when the expression in if is False.
Syntax
if expression:
  statements 
else:
  statements 

if expression:
  statements 
elif expression:
  statements 
else:
  statements 
Parameters
expressionany valid expression that evaluates to true or false
statementsone or more statements to be executed
Related if
if

Updated on Sat Oct 24 11:26:09 2026.

If you see any errors or have comments, please let us know.

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.