From the course: Grasshopper and Rhino: Python Scripting

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Comparing with operators

Comparing with operators

From the course: Grasshopper and Rhino: Python Scripting

Start my 1-month free trial

Comparing with operators

- [Instructor] In previous videos, we have used the equal to symbol to check the equality of two values. This is known as a Comparison Operator. Comparison Operators are useful for comparing one value to another. For example, if we wanted to compare the volume of two spheres, or the length of two lines, we would do so using a Comparison Operator. Let's have a look at some of the other Comparison Operators we can use. Before we do, however, let's have a quick look at the boolean data type, which I'm sure you've come across in Grasshopper. This simply contains a point driven by three sliders. For now, let's place a new Python component onto our canvas. And we'll double-click to open it up. A boolean is either one of two states, true or false. Think of this like a switch. The switch is either on, true, or off, false. To create a boolean, we simply assign to a variable true or false with a capitalized letter. For example, let's create two variables, T and F, and we'll assign to these the…

Contents