Understanding the Colorization of Code in VEXcode IQ Python

When creating Text projects, the syntax, spacing, indenting, and spelling in your code in very important to ensure that your project runs as intended. The color coding present in the Workspace in VEXcode IQ Python is an extra visual cue that you have entered your code into your project correctly.

If there is an unrecognizable component while typing commands into the Workspace, it will remain black (like the user-created category). This can be a useful indicator as you are working to prevent frustration or extra troubleshooting later on.

Use the cursor and keyboard to correct errors. As the components are recognized, they will be colorized correctly.

The colorization of code follows the following conventions:

Classes

A line of Python code reads drivetrain.drive(FORWARD). The term drivetrain is colored gray blue and is highlighted in a red box.

The individual device the command pertains to (i.e. drivetrain, pen, brain)

Commands

A line of Python code reads drivetrain.drive(FORWARD). The term drive is colored brown and is highlighted in a red box.

The behavior within the command (i.e. drive, turn)

Parameters

A line of Python code reads drivetrain.drive(FORWARD). The term FORWARD is colored orange and is highlighted in a red box.

Information about how the behavior executes (i.e. direction, distance)

Structures

A line of Python code reads if left_bumper.pressed(). The term if is colored blue and is highlighted in a red box.

Control the flow of the project (i.e. conditionals, loops)

Values

A line of Python code reads drivetrain.turn_for(RIGHT, 90, DEGREES). The term 90 is colored dark green and is highlighted in a red box.

Numerical parameter assigned to the behavior (i.e. number of degrees of a turn)

User Created

A line of Python code reads for value in range(10). The term value is colored black and is highlighted in a red box.

User created variables and commands

Comments

A Python comment reads # Comments in a project. The entire line of code is colored bright green.

The text following a # that will not effect the program.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: